Notifications
Clear all
BugOverflow
1
Posty
1
Users
0
Reactions
1,438
Widok
0
05/02/2020 10:15 am
Topic starter
list
1 Answer
0
05/02/2020 10:15 am
Topic starter
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) var array = arrayOf("Melbourne", "Vienna", "Vancouver", "Toronto", "Calgary", "Adelaide", "Perth", "Auckland", "Helsinki", "Hamburg", "Munich", "New York", "Sydney", "Paris", "Cape Town", "Barcelona", "London", "Bangkok") val myAdapter = ArrayAdapter(context!!, android.R.layout.simple_list_item_single_choice, array) lista.adapter = myAdapter lista.onItemClickListener = AdapterView.OnItemClickListener { _, view, _, _ -> view.isSelected = true } }