0
我有一個AlertDialog.Builder,但問題是,當AlertDialog.Builder顯示我無法點擊工具欄becase AlertDialog。生成器繪製在所有其他視圖之上..我如何使AlertDialog.Builder不能取消但仍然能夠點擊工具欄項目。android:位置AlertDialog.Builder下面的工具欄,以便即使AlertDialog顯示時,可以點擊NavigationDrawer
這裏的快照是我的代碼:
final AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
//Set title
builder.setTitle("Approval Pending")
//Set message
.setMessage("Your account with Reference Id [" + jObj0.getString("reference_id") + "] is in Pending state.")
.setNegativeButton("REFRESH", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if(Utils.isConnected(getContext())) {
dialog.dismiss();
fetchdashboardfragmentdata(true);
}else{
builder.show();
Toast.makeText(getContext(), "Please turn on your Internet connection and try again", Toast.LENGTH_SHORT).show();
}
}
})
.setPositiveButton("LOGOUT", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
StoreSharePreference.SSP().logout(getContext());
Intent intent = new Intent(getContext(), Login_Page.class);
intent.setFlags(intent.FLAG_ACTIVITY_CLEAR_TOP | intent.FLAG_ACTIVITY_NEW_TASK | intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
getActivity().finish();
}
})
.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
return true;
}
return false;
}
})
.setCancelable(false);
AlertDialog alert = builder.create();
alert.show();
- 我希望能夠點擊車圖標,圖標wishist和導航抽屜時AlertDialog .Builder正在顯示 -
顯示您的代碼.. \ –
嘗試使用'progressDialog.setCancelable(false);' –
添加了代碼。 –