2015年1月2日金曜日

OKダイアログ



なんかダイアログを出す方法がいくつかあるっぽいけど、これが一番シンプルかな。

        // ダイアログテスト
        // import android.app.AlertDialog;
        // import android.content.DialogInterface;

        AlertDialog.Builder alertDlg = new AlertDialog.Builder(this);
        alertDlg.setTitle("ダイアログタイトルです");
        alertDlg.setMessage("メッセージです");
        alertDlg.setPositiveButton(
                "OK",
                new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        // OK ボタンクリック処理
                    }
                });
        // 表示
        alertDlg.create().show();


http://androidguide.nomaki.jp/html/dlg/alert/alertdlgMain.html

0 件のコメント:

コメントを投稿