Step 3: Create a resource under android/res/layout that could be used for each element of the array while displaying in ListView. var array = arrayOf("Melbourne", "Vienna", "Vancouver", "Toronto", "Calgary", "Adelaide", "Perth", "Auckland", "Helsinki", "Hamburg", "Munich", "New York", "Sydney", "Paris", "Cape Town", "Barcelona", "London", "Bangkok") Step 2: Have an array of elements, in the MainActivity.kt class file, to be displayed as ListView. Step 1: Create ListView in activity_main.xml layout file. Steps to display items of an array as Kotlin Android ListView
0 Comments
Leave a Reply. |