how to create the textview in code not in xml file. It is because number of textviews will be changing in my application according to some integer.
Maybe thats what you need:
LinearLayout lin = (LinearLayout) findViewById(R.id.myLinear); for (int i = 0; i <= 10 ; i++) { TextView myText = new TextView(this); myText.setText("textview# "+ i); lin.addView(myText); }