What is a textViewResourceId?

android, android-arrayadapter

Solution

it is the id of the `textview` in which the adapter will update the info you will provide. You can use `textview` provided by android:

android.R.id.text1

for instance. Or you can provide your own `textView` whit your custom id

Edit

change:

ArrayAdapter(this,android.R.layout.simple_list_item_1,myArrayList)

with

ArrayAdapter(this,android.R.id.text1,myArrayList)

Problem

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

Original source