DialogInterface.OnClickListener clickListener= new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which)
{
case BUTTON_POSITIVE :
udb.signout();
break;
case BUTTON_NEGATIVE:
finish();
break;
}
}
};
AlertDialog.Builder builder = new AlertDialog.Builder(getApplicationContext());
builder.setTitle("Notification");
builder.setMessage("You are already logged in.\nDo you want to signout and login with different account?");
builder.setPositiveButton("Yes",clickListener);
builder.setNegativeButton("No",clickListener);
builder.show();
這是我的代碼顯示彈出對話框..但我得到問題 「builder.show()」行。我不明白我做錯了什麼。請。我會感謝任何幫助沒有顯示alertdialog框
考慮添加錯誤消息 –