我期待这样的事情...
Activity currentActivity =
((MyApp)context.getApplicationContext()).getCurrentActivity();
...但对话框。
喜欢的东西getCurrentView()
返回在前面跑,然后我可以从外面关他们的最新观点。
我没有对话的情况下调用解雇。
是否有任何约束,我可以和他控制运行任何窗口?
我创建的对话是这样的:
final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(mContext).setView(dialogView)
.setTitle(mPolicyInterface.getTitle()).setMessage(mPInterface.getSubTitle());
有3种方式来做到这一点
@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;
}
});