I'm adding TextViews programmatic using a for-loop and use setId(Int int) to set unique id for that perticular Textview. But now I want to search textView on the basis of that id. How can I search?
erorr occurd 'app stopped unexpectedly...' Here is my code.
public class Idtest extends Activity {
TextView tv;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LinearLayout ll=new LinearLayout(this);
tv=new TextView(this);
tv.setText("Hello");
ll.addView(tv);
tv=new TextView(this);
tv=(TextView)ll.getChildAt(1);
setContentView(tv);
}
}