I've been trying to figure how the ArrayAdapter class can be used, and from the docs : http://developer.android.com/reference/android/widget/ArrayAdapter.html, I see the constructor expects an integer called textViewResourceId.
What is this exactly?
Edit: From a little more research and the answers here, it looks like it must be the id of a TextView that I defined in the xml file that contains the interface code. But I saw this example here:
ArrAdapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1,myArrayList)
So how can android.R.layout.simple_list_item_1 be used here? What does this mean really? I am only familiar with using R.id.idOfMyViewHere
android.R.layout.simple_list_item_1 is default layout if you want to use your layout then you can also use it like
new ArrayAdapter<String>(context, layout_id, textview_id, items);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With