Android : How can I have XML layout and the views that I added to my layout?



I have a relative layout and some textviews in it... I defined this relative layout in the java, and add a view to it. but in the result I just have the view that I added to layout .. and it doesn't show any text boxes..



SampleView sample= new SampleView(this);
rl=(RelativeLayout) findViewById(R.id.rl);
rl.addView(sample);


how can I fix it? (in this code, it just shows the sample view's object ... not textviews that I have in the layout)


No comments:

Post a Comment