我有當用戶單擊後退按鈕上的裝置,它被調用的警告對話框,但此警報太短,並且用戶不能讀什麼裏面或做任何事情與它..警報對話框週期短
AlertDialog alertDialog = new AlertDialog.Builder(birthDate.this).create();
// Setting Dialog Title
alertDialog.setTitle("Alert Dialog");
// Setting Dialog Message
alertDialog.setMessage("Welcome to AndroidHive.info");
// Setting OK Button
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// Write your code here to execute after dialog closed
Toast.makeText(getApplicationContext(), "You clicked on OK", Toast.LENGTH_LONG).show();
}
我想使這個警告對話框不再
你是指敬酒期間還是alertDialog?因爲alertdialog不會在這裏忽略你的代碼(你沒有調用dismiss()方法),並且爲了舉杯,你可以指定持續時間的參數爲10000毫秒(10秒),例如 – Houcine
看看這個http://stackoverflow.com/questions/2220560/can-an-android-toast-be-l-long-than-toast-length-long – user1840039
你能解釋你正在談論的警報對話或吐司的天氣嗎? – Sameer