AlertDialog

创建一个AlertDialog:

<textarea cols="50" rows="15" name="code" class="c-sharp">AlertDialog menuDialog; menuDialog = new AlertDialog.Builder(this).create(); menuDialog.setView(menuView); menuDialog.setTitle("用户文档"); menuDialog.setMessage("adsafsdgdhhhhhdfh"); menuDialog.setOnKeyListener(new OnKeyListener() { public boolean onKey(DialogInterface dialog,int keyCode, KeyEvent event) { // 监听按键 if (keyCode ==KeyEvent.KEYCODE_MENU) dialog.dismiss(); return false; } });</textarea>

 

显示该AlertDialog:

 

<textarea cols="50" rows="15" name="code" class="c-sharp">menuDialog.show();</textarea>

你可能感兴趣的:(AlertDialog)