0
AlertDialog.Builderがありますが、AlertDialog.Builderが表示されているときにツールバーをクリックできません。ビルダーは他のすべてのビューの上に描画されます。どのようにしてこのAlertDialog.Builderをキャンセルすることはできませんが、引き続きツールバーアイテムをクリックすることができます。ここアンドロイド:ツールバーの下にAlertDialog.Builderを配置すると、AlertDialogが表示されていてもNavigationDrawerをクリックできるようになります。
のスナップショットであるMY CODE IS:
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();
--IはときAlertDialogカートアイコン、wishistアイコンとナビゲーションの引き出しをクリックすることができるようにしたいです.Builderが表示されています.---
コードを表示.. \ –
'progressDialog.setCancelable(false);を使用してください。 –
にコードが追加されました。 –