0

ダイアログポップアップがあります。その中にボタンがあります。ボタンをクリックすると、確認のポップアップ (はい/いいえ) が表示されます。しかし問題は、ダイアログのポップアップが閉じたことです。確認ポップアップが表示されたときに、ダイアログ ポップアップを閉じたくありません。やり方を知りたいです。ここで私のコーディング..

    Button deleteBtn = (Button) findViewById(R.id.deleteBtn);
    deleteBtn.setOnClickListener(new OnClickListener(){
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("Choose delete tasks");
        builder.setPositiveButton("Delete", new DialogInterface.OnClickListener()   {               
         public void onClick(DialogInterface dialog, int which) {
            showMsgDialog();
        }
    });

    private void showMsgDialog() {
        AlertDialog alertDialog = new AlertDialog.Builder(this).create();

        // Setting Dialog Title
        alertDialog.setTitle("deleting..");

        // Setting Dialog Message
        alertDialog.setMessage("Are you sure want to delete?");
        alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                  // deleting process.
            }
        });
        alertDialog.show();
}

ありがとう。

4

1 に答える 1