I am trying to draw a image at dynamic positions on top of a RelativeLayout that has other elements. I tried creating a class that extends View and add this view to the RelativeLayout but the image is only thing that is shown on the screen. The other elements in the RelativeLayout are not visible.
this is the view class
@Override
protected void onDraw (Canvas canvas) {
super.onDraw(canvas);
Bitmap myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
canvas.drawColor(Color.BLACK);
canvas.drawBitmap(myBitmap, 50,50, null);
}
this is in the onCreate of the Activity
mainLayout = (RelativeLayout)findViewById(R.id.main_tutorial_layout);
mainLayout.addView( new DrawAnimationTutotial(getApplicationContext()));
mainLayout.invalidate();