Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Sowmya It seems that you are creating multiple textviews &amp; trying to update those textviews .In that case you need to use <a href="http://developer.android.com/reference/android/view/View.html" rel="nofollow">setTag()</a> and <a href="http://developer.android.com/reference/android/view/View.html" rel="nofollow">getTag()</a> .</p> <p>There is an example you can find <a href="http://jongladwin.blogspot.com/2010/03/androidsettag-and-gettag-usage-for.html" rel="nofollow">here</a></p> <p>Regarding your answer:</p> <blockquote> <p>we r declaring textview array so am unable to load to existing textview</p> </blockquote> <p>I have never implemented such a textview array instead the best practice would be to </p> <pre><code> for (String s : stringarray) { TextView tv = new TextView (this); tv.setText(s); tv.setTag("1"); linearlayout.addView(tv); } </code></pre> <p>*<strong>EDIT:</strong>*For those enthusiast out there I found 2 more methods:</p> <p>One is using <a href="http://developer.android.com/reference/android/view/View.html#setId%28int%29" rel="nofollow">setId()</a> to manually set ID of that textview &amp; then find it by <a href="http://developer.android.com/reference/android/view/View.html#findViewById%28int%29" rel="nofollow">findViewById()</a></p> <p>Another method(is though not implemented by me , but is a suggestion by my colleague so dont kill me if it doesn't works) is to store textview objects in an arraylist &amp; then access them &amp; do whatever you want whoa!</p>
 

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