Q: Make an Image as a backgound in java android for edit I had created an image by the following code:
Bitmap bmp = Bitmap.createBitmap(512, 512, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bmp);

try {
    int tile1ResID = getResources().getIdentifier("drawable/m" + String.valueOf(tileOfPoint.x) + "_" + String.valueOf(tileOfPoint.y), "drawable", "com.example.sabtt1");

    canvas.drawBitmap(Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getResources(), tile1ResID), 256, 256, true), 0, 0, null);
    canvas.save();
}
catch (Exception e) {
}

canvas.save();

ImageView imgMap1 = (ImageView) findViewById(R.id.imgMap1);
imgMap1.setImageDrawable(new BitmapDrawable(Bitmap.createBitmap(bmp, 0, 0, 500, 500)));

now I want to make it as background. So that the user can add an image or draw on it. 
How can I set it as background?
Is it possible to add the image and draw by finger at the same time?
I use this code for draw:
@Override
public void onClick(View arg0) {
    try {
        Bitmap gestureImg = gesture.getGesture().toBitmap(100, 100, 8, Color.BLACK);

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        gestureImg.compress(Bitmap.CompressFormat.PNG, 100, bos);
        byte[] bArray = bos.toByteArray();

        Intent intent = new Intent(Activity1.this, Activity2.class);

        intent.putExtra("draw", bArray);
        startActivity(intent);
    }
    catch (Exception e) {
        e.printStackTrace();
        Toast.makeText(Activity1.this, "No draw on the string", 3000).show();
    }
}

and OnDragListener for add and move images. 
I know that I should use the folowing code for background:
LinearLayout ll = new LinearLayout(this);
    ll.setBackgroundResource(R.drawable.nn);
    this.setContentView(ll);

but by using this code, I can't see other images.
Thanks in advance. 

A: You can just draw on the main bitmap the other bitmaps:
Bitmap bmp = Bitmap.createBitmap(512, 512, Bitmap.Config.ARGB_8888);
bmp = <load from resource>
Canvas canvas = new Canvas(bmp);
Bitmap gestureImg = <get bitmap from gesture or loading>
canvas.drawBitmap(gestureImg);

then load the final bitmap:
ImageView imgMap1 = (ImageView) findViewById(R.id.imgMap1);
imgMap1.setImageDrawable(new BitmapDrawable(Bitmap.createBitmap(bmp, 0, 0, 500, 500)));

Or you can store the main bitmap and all other gesture/loaded bitmaps in separate objects and when you want to update the imgMap1 you make your combined bitmap;
Also to use as background the new bitmap use:
ll.setBackgroundDrawable( new BitmapDrawable( bmp ) );

