i am making an app with alert dialogs and i have a problem, my alertdialog shown on the right if I put a negative the two are to the right how can i center the positiveButton?
public void showBandDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = LayoutInflater.from(getActivity());
final View view2 = inflater.inflate(R.layout.bluetooth_dialog, null);
if(bluetoothIsActive){
ImageView bluetootIndicator = (ImageView) view2.findViewById(R.id.bluetooth_indicator);
bluetootIndicator.setImageResource(R.drawable.checked);
}
if(bluetoothIsSaved){
ImageView bluetootSavedIndicator = (ImageView) view2.findViewById(R.id.bluetooth_saved_indicator);
bluetootSavedIndicator.setImageResource(R.drawable.checked);
}
builder.setTitle(Html.fromHtml("<font color='#55BFE7'>Bluetooth</font>"));
builder.setPositiveButton("Done",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {}
});
builder.setView(view2);
final AlertDialog alertDialog = builder.create();
alertDialog.setOnShowListener(new OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
Button okButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
alertDialog.dismiss();
}
});
}
});
alertDialog.show();
}