In my code Im showing the project name in the list view. But I want to show the name of all added Contacts.
showAllContactsBtn.setOnClickListener(){
val arrayAdapter: ArrayAdapter<Contact> = ArrayAdapter(
this,android.R.layout.simple_list_item_1,listOfAllNames
)
listNames.adapter = arrayAdapter
listNames.setOnItemClickListener { adapterview, view, x, y ->
Toast.makeText(this, "Contact picked" + listofAllnames[x].name, Toast.LENGTH_LONG).show()
}
How do I show the names like in Toast "list of All names . name"?