Kotlin

A series of complete step-by-step tutorials to walk you through how to accomplish different tasks in Kotlin, from Getting Started to writing Android applications

SharedPreferences in Kotlin Android Studio

SharedPreferences | Android Studio | Kotlin SharedPreferences is one of the types of saving data in Android Devices. You can save String, int, boolean, long, float, and Set<String>  types of data in SharedPreferences. In SharedPreferences data is saved in the key-value form. If you have a relatively small collection of key-values that you’d like to save, then you should use the SharedPreferences APIs. You can Add, Edit/Modify and Remove data from the SharedPreferences easily.To […]

SharedPreferences in Kotlin Android Studio Read More »

Options Menu Fragment – Android Studio – Kotlin

Add setHasOptionsMenu(true) in the onCreate() method to invoke the menu items in your Fragment class. You don’t need to override onCreateOptionsMenu in your Fragment class again.  Menu items can be changed (Add/remove) by overriding onPrepareOptionsMenu method available in Fragment. This will cover the followings: Use Options Menu / Actionbar menu Use Options Menu in fragments Add items with icons in options menu Show

Options Menu Fragment – Android Studio – Kotlin Read More »

ListView using Array with Item Click Listener Kotlin

How to create a ListView from array in Kotlin using Android Studio? In this tutorial we will create a ListView using array, array items will be displayed in ListView. We will also handle Item Clicks, I’ll display a Toast on each item click, you can do your functionality. Step 1: Create a new project OR Open your project Step 2: Code activity_main.xml MainActivity.kt Step

ListView using Array with Item Click Listener Kotlin Read More »

ListView using Array from strings.xml with Item Click Listener kotlin

How to create a ListView from array in strings.xml in Kotlin using Android Studio? In this tutorial we will create a ListView with Item Click Listener, we will write string array in strings.xml. When a list item is clicked a Toast will be displayed, you can change the functionality. Step 1: Create a new project OR Open your project Step 2: Code

ListView using Array from strings.xml with Item Click Listener kotlin Read More »

How to create a MultiChoice AlertDialog in Android (Kotlin)

In this tutorial we will create a MultipleChoice AlertDialog using Android Studio. We will show list of colors to show in dialog. We will create a Button to show that AlertDialog, and a TextView to show the selected items… Step 1: Create a new project OR Open your project Step 2: Code activity_main.xml MainActivity.kt Step 3: Outpu

How to create a MultiChoice AlertDialog in Android (Kotlin) Read More »