- privatevoiddialog(){
- AlertDialog.Builderbuilder=newBuilder(PPTSoftwareActivity.this);
- builder.setMessage("确认要退出么?");
- builder.setTitle("提示");
- builder.setPositiveButton("确定",newDialogInterface.OnClickListener(){
- publicvoidonClick(DialogInterfacedialog,intwhich){
- //TODOAuto-generatedmethodstub
- dialog.dismiss();
- finish();
- }
- });
- builder.setNegativeButton("取消",newDialogInterface.OnClickListener(){
- publicvoidonClick(DialogInterfacedialog,intwhich){
- //TODOAuto-generatedmethodstub
- dialog.dismiss();
- }
- });
- builder.show();
- }
- @Override
- publicbooleanonKeyDown(intkeyCode,KeyEventevent){
- //TODOAuto-generatedmethodstub
- if(keyCode==KeyEvent.KEYCODE_BACK){
- dialog();
- }
- returnfalse;
- }