Tag: android alertdialog

具有自定义背景颜色的Android AlertDialog setMultiChoiceItems

我得到了这个alertDialog,有多项选择: builder.setTitle(R.string.layer_options_title) .setMultiChoiceItems(availableOptions, selectedLayerOptions, new DialogInterface.OnMultiChoiceClickListener() { … }); 哪里 availableOptions = getApplicationContext().getResources().getStringArray(R.array.layer_options); 来自 Should have green background Should have yellow background Should have orange background Should have blue background 有没有办法让这些多选项具有背景颜色?

另一个警报对话框后的警报对话 第一个缺失! 安卓

我有一个活动(ImportActivity),其中用户输入一些度量的值并将它们保存到sqlite数据库中。 当用户在导入到数据库后单击“保存”按钮时,我有一个警告对话框(SAVEORBACK_DIALOG_ID),用户可以在此处离开此活动或导入另一个度量。它工作正常。 我的问题是当我尝试在(SAVEORBACK_DIALOG_ID)警告对话之前显示另一个警报对话框(SMS_DIALOG_ID)时。这是因为我想要求用户发送或不发送短信。 当我运行它时它只显示第二个警告对话框 (SAVEORBACK_DIALOG_ID)! 我在活动中: static final int DATE_DIALOG_ID = 0; static final int TIME_DIALOG_ID = 1; static final int SAVEORBACK_DIALOG_ID = 2; static final int SMS_DIALOG_ID = 3; 我从我的活动中打电话给他们: // sms dialog(send sms to doctor?yes/no) showDialog(SMS_DIALOG_ID); // save or back dialog showDialog(SAVEORBACK_DIALOG_ID); 这是onCreateDialog方法,我有我的对话框(我删除了一些更容易阅读): @Override protected Dialog onCreateDialog(int id) { switch (id) { case […]

如何在应用程序外部显示AlertDialog框?

@Override public void run() { //Create thread that can alter the UI AlarmPage.this.runOnUiThread(new Runnable() { public void run() { cal = Calendar.getInstance(); //See if current time matches set alarm time if((cal.get(Calendar.HOUR_OF_DAY) == alarmTime.getCurrentHour()) && (cal.get(Calendar.MINUTE) == alarmTime.getCurrentMinute())){ //If the sound is playing, stop it and rewind if(sound.isPlaying()){ ShowDialog(); alarmTimer.cancel(); alarmTask.cancel(); alarmTask = new PlaySoundTask(); alarmTimer […]