我已經在我的應用程序中實現了BaseActivity模式,除了嘗試顯示警報對話框時,一切都很好。這是發生了什麼Android Alert對話框空白白色背景
當我嘗試取消對話框我留下了這一點。
下面是用於示出駐留在基底活動對話框中的代碼:
new AlertDialog.Builder(this)
.setTitle("Logging out")
.setMessage("Are you sure?")
.setPositiveButton("Yes", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
UIUtils.setAnimation(swipeRefreshLayout, true);
UserBaas.logoutUser();
}
})
.setNegativeButton("No", null)
.show();
此問題是持續在一個仿真器與在實際設備上。可能是什麼問題?
switch (item) {
case NAVDRAWER_ITEM_HOME:
startActivity(new Intent(this, MainActivity.class));
break;
case NAVDRAWER_ITEM_MEMOS:
intent = new Intent(this, MemoGroupActivity.class);
intent.putExtra("section", MemoGroupActivity.MEMO);
createBackStack(intent);
break;
case NAVDRAWER_ITEM_GROUPS:
intent = new Intent(this, MemoGroupActivity.class);
intent.putExtra("section", MemoGroupActivity.GROUP);
createBackStack(intent);
break;
case NAVDRAWER_ITEM_CONNECTIONS:
createBackStack(new Intent(this, ConnectionsActivity.class));
break;
case NAVDRAWER_ITEM_DOCUMENTS:
createBackStack(new Intent(this, DocumentsActivity.class));
break;
case NAVDRAWER_ITEM_SETTINGS:
createBackStack(new Intent(this, SettingsActivity.class));
break;
case NAVDRAWER_ITEM_LOGOUT:
showLogoutDialog();
break;
}
而且繼承人的UIUtils.setAnimation()
public static void setAnimation(SwipeRefreshLayout swipeRefreshLayout, boolean value) {
swipeRefreshLayout.setEnabled(value);
swipeRefreshLayout.setRefreshing(value);
}
所以你的問題是UserBaas.logoutUser()不會被調用? –
不,問題是背景是空白的,即使在對話框消失後它仍然是空白的。 – Michael
一次嘗試相同的活動,而不是使用BaseActivity。 –