出于某种原因,当我显示AlertDialog时 - 显示警报,但是按下时按钮都没有响应。注意:我通过推送通知调用警报(不确定它是否有所作为。)
import cn.pedant.SweetAlert.SweetAlertDialog;
...
public class Setup extends FragmentActivity implements OnMenuItemClickListener{
...
public void newAlert() {
SweetAlertDialog alert;
alert = new SweetAlertDialog(Setup.getInstance(), SweetAlertDialog.NORMAL_TYPE);
alert.setTitleText("Cruise Planners Mobile");
alert.setContentText("Currently No Agents Available");
alert.setCancelable(true);
alert.setCancelText("Cancel");
alert.setConfirmText("Retry");
alert.showCancelButton(true);
alert.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sDialog) {
sDialog.dismiss();
DataManager.clientChatSendRequest(Setup.getInstance());
}
});
alert.setCancelClickListener(new SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sDialog) {
sDialog.dismiss();
}
});
alert.show();
}
...
public class GCMIntentService extends GCMBaseIntentService {
...
Setup alert = new Setup();
alert.newAlert();
...
答案 0 :(得分:0)
尝试在alert.show()之前添加此行:
.pc
并添加到您的清单中:
alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);