私はアンドロイドが初めてです。
AlertDialog
現在、「OK」と「キャンセル」ボタンのあるボックスを表示したいと考えています。
デフォルトは PositiveButton: Left、NegativeButton: Right です。
PositiveButton を右側に、NegativeButton を左側に移動する方法を教えてください。
「OK」を「NegativeButton」に、「Cancel」を「PositiveButton」に変更すると、OK を押したときに Negativebutton が悪い音を出す可能性や問題はありますか。
私のコード:
AlertDialog.Builder builder = new AlertDialog.Builder(SUtils.getContext());
builder.setMessage("Confirmation?")
.setCancelable(false)
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//Todo
dialog.cancel();
}
})
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//TOdo
}
})
dialog = builder.create();
ありがとう、天使