Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>But again main doubt why TextView resource id it needs?</p> </blockquote> <p>Look at the constructor and the params.</p> <pre><code>public ArrayAdapter (Context context, int resource, int textViewResourceId, T[] objects) </code></pre> <blockquote> <p>Added in API level 1 Constructor</p> <p>Parameters </p> <p><code>context</code> The current context. </p> <p><code>resource</code> The resource ID for a layout file containing a layout to use when instantiating views.</p> <p><code>textViewResourceId</code> The id of the TextView within the layout resource to be populated objects The objects to represent in the <code>ListView</code>.</p> </blockquote> <p><code>android.R.id.text1</code> refers to the id of text in android resource. So you need not have the one in your activity.</p> <p>Here's the full list</p> <p><a href="http://developer.android.com/reference/android/R.id.html" rel="nofollow">http://developer.android.com/reference/android/R.id.html</a></p> <pre><code>ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, android.R.id.text1, values); </code></pre> <p><code>this</code> refers to activity context</p> <p><code>android.R.layout.simple_list_item_1</code> simple_list_item_1 is the layout in android.R.layout.</p> <p><code>android.R.id.text1</code> refers to the android resource id.</p> <p><code>values</code> is a string array from the link you provided</p> <p><a href="http://developer.android.com/reference/android/R.layout.html" rel="nofollow">http://developer.android.com/reference/android/R.layout.html</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload