AlertDialogのキャンセルや閉じるイベントのハンドリングは、Dialogクラスのリスナー設定メソッドを使用します。 import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; public class MyClass extends Activity{ public void myMethod(){ AlertDialog.Builder bldr = new AlertDialog.Builder(this); AlertDialog dialog = bldr.create(); // キャンセル dialog.setOnCancelListener(new DialogInterface.OnCancelListener(){ publ
![【Android】ダイアログのキャンセル・閉じる](https://cdn-ak-scissors.b.st-hatena.com/image/square/6fa5f8571b7e3b5579e4ed3cbd3aa47b2783c40b/height=288;version=1;width=512/https%3A%2F%2Fsoftwarenote.info%2Fwp-content%2Fuploads%2F2020%2F09%2Ftitle_blog-1.png)