Question: 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)

Answer: 
Debugging is your solution.

* Make sure that the view that you are adding does not overlap your textView.
* Make sure your textview has text. Try checking its size in run time.

And finally use Android Studio layouting tool, to have a preview of your layout. You can use [tools](http://tools.android.com/tech-docs/tools-attributes) to generate something suitable for preview.
I solved it. my mistake was:

```
canvas.drawColor(Color.WHITE); 

```

in the onDraw ...