I'm trying to add a View on top of another one.
First I am setting a view via the xml and then I want to add the second one programatically. public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LinearLayout ll = (LinearLayout) findViewById(R.id.layout);
drawView = new DrawView(this);
drawView.setBackgroundColor(Color.TRANSPARENT);
Bitmap bitmap = Bitmap.createBitmap(10, 100, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawView.draw(canvas);
drawView.setLayoutParams(new LayoutParams(800, 0, 0.18f));
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams)drawView.getLayoutParams();
params.setMargins(0, 0, 0, -130);
drawView.setLayoutParams(params);
ll.addView(drawView, 2);
}
My problem is that the xml is on top of the view that I am trying to add.
How can I make the second view on top?