How to get a phone_Number from contacts ListView on onItemClicklistener
In your onItemClick()
, you're using li.findViewById()
.
But, onItemClick()
returns View
as an argument of the clicked item, which is also mentioned in the official documentation.
Hence, try updating it as
TextView txtNummber = view.findViewById(android.R.id.text2)
.
Check if it works.