Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a textViewResourceId?

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

like image 809
GrowinMan Avatar asked Apr 05 '12 09:04

GrowinMan


1 Answers

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);

like image 104
Niranj Patel Avatar answered Nov 12 '22 20:11

Niranj Patel