The image below is essentially what I want to achieve, this comes straight out of eclipse as my dialog_layout.xml
I want to inflate a custom dialog and have it on the right of screen to serve as a menu. Everytime, I try to show this DialogFragment
, the layout below centres itself to the centre of the screen. (The code for the onCreateDialog()
of the `DialogFragment1 is below the image.
Is there any way to achieve this? Do I have to create an Activity using a dialog theme?
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
// Create a new Dialog using the AlertDialog Builder
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View background = getActivity().getLayoutInflater().inflate(R.layout.dialog_layout, null);
builder.setView(background);
return builder.create();
}
Any help would be appreciated!
Cheers