Reputation: 2209
I have created some TextView in the view ml, about 5 of them. But the problem is that after I read from xml file the values come, more than 5 sometimes, and there is no limit. It could be better more than 10. However if I can create the TextView from the activity, then I think I can do it somehow.
Upvotes: 0
Views: 1383
Reputation: 5640
Assuming you want it add to a view called containingView
,
TextView myTextView = new TextView(containingView.getContext());
myTextView.setText("alshareef");
containingView.addView(myTextView);
Upvotes: 2