我有一个正常显示的警告对话框,正如我打算的那样。问题是,当我从任何活动触发警报时,它会打开看起来是空白布局的内容,然后在空白布局内打开警报对话框。我希望我的警报对话框在用户触发时所处的活动中打开。这是我的代码:AlertDialog后台活动
AlertDialog dialog = new AlertDialog.Builder(this)
.setCancelable(false)
.setView(getLayoutInflater().inflate(R.layout.activity_about_t2m, null))
.create();
dialog.setTitle("About T2M");
dialog.show();
我认为问题可能是第二个参数,但我怎么才能检测到当前活动?
http://www.mkyong.com/android/android-custom-dialog-example/ –