如何关闭运行的任何提示,不知道这是对话?

问题描述 投票:0回答:1

我期待这样的事情...

Activity currentActivity = 
((MyApp)context.getApplicationContext()).getCurrentActivity();

...但对话框。

喜欢的东西getCurrentView()返回在前面跑,然后我可以从外面关他们的最新观点。

我没有对话的情况下调用解雇。

是否有任何约束,我可以和他控制运行任何窗口?

我创建的对话是这样的:

final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext).setView(dialogView)
                .setTitle(mPolicyInterface.getTitle()).setMessage(mPInterface.getSubTitle());
android
1个回答
1
投票

有3种方式来做到这一点

  1. 创建一个单独的对象
  2. 要使用对话片段
  3. 重新设置按监听器 dialog.setOnKeyListener(新Dialog.OnKeyListener(){ @Override public boolean onKey(DialogInterface arg0, int keyCode, KeyEvent event) { // TODO Auto-generated method stub //Back Key for edit shift amount fix if (keyCode == KeyEvent.KEYCODE_DEL) { return false; } if (keyCode == KeyEvent.KEYCODE_BACK) { dialog.dismiss(); } return true; } });
© www.soinside.com 2019 - 2024. All rights reserved.