How would I open my dialog so its in a set position below a Button widget?
This is what I have so far:
public void showPopup(View v){
mDialog.setContentView(R.layout.dialog_custom_workout_info);
Window window = mDialog.getWindow();
window.setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
window.setGravity(Gravity.CENTER_HORIZONTAL);
window.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
mDialog.getWindow().setDimAmount(0);
mDialog.show();
}
The Dialog opens, but I can only use the gravity to center it, but I would like it opening at a set position relative to another widget ( in this case the widget is labelled "imageButton".
Thanks in advance!