Q:

Android how to show the button over the imageview in android

I want to show the button over the image in image view. Can any one have any idea how to do this. I'm new in android programming.
Thanks.

A:

By using this u can create the button on the Bitmap dynamically...
public class MainAct extends GrapActivity implements OnClickListener {

private Button saveButton;
private Button clearButton;

// onCreate Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);          

 // content view 
signature = new MyView(this); 

// Dynamically created button on bitmap & canvas

RelativeLayout myLayout = new RelativeLayout(this);        
myLayout.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); 

// For Save Button
saveButton = new Button(this); 
saveButton.setText("Save"); 
saveButton.setOnClickListener(this); 

// For Clear Button
clearButton = new Button(this); 
clearButton.setText("Clear"); 
clearButton.setOnClickListener(this); 

myLayout.addView(signature); 
myLayout.addView(saveButton); 
myLayout.addView(clearButton); 

RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT); 
//Alignments
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); 
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT); 
saveButton.setLayoutParams(params); 

//Alignments
RelativeLayout.LayoutParams params2 = new RelativeLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT); 
params2.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); 
params2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); 
clearButton.setLayoutParams(params2); 

saveButton.bringToFront(); 
clearButton.bringToFront(); 
this.setContentView(myLayout); 
new Thread(new RefreshRunner()).start(); 

 // onclick listner for CLEAR button
 clearButton.setOnClickListener(new OnClickListener() {          
    public void onClick(View v) {
        //Activity for Clearing the Screen
        startActivity(new Intent(ThisAct.this, ThisAct.class));
        finish();
    }
});

// onclick listner for SAVE button
    saveButton.setOnClickListener(new OnClickListener() {  
        public void onClick(View v) { 
            //capture the image  
            try {                    
                saveAsJpg(mBitmap);     
                startActivity(new Intent(ThisAct.this, MainActivity.class));
                finish();
            } catch (IOException e) {                   
                e.printStackTrace();
            } 
        }  
    });     
 } 

}

