I use this codes for Android (Java) programming:
public static MessageBoxResult showOk( Context context, String title, String message, String okMessa
Useandroid.support.v7.app.AlertDialog which will align your positive and negative buttons in center.
android.support.v7.app.AlertDialog
android.app.AlertDialog will place the button in the top leaving 16dp space in bottom.
android.app.AlertDialog