[英]How to show an Alert Dialog for a background FCM message when notification is pressed
当我从完整顶部向下滑动时,我按下android设备顶部通知栏中显示的Firebase推送通知时,我希望获得一些帮助来显示警报对话框。
按下通知栏中的通知后,我需要它来打开活动并显示带有“确定”按钮的通知消息的警报对话框。
可能有人请帮助我在Android Studio 3.0.1上这样做
尝试这个希望,对您有帮助
Intent notifyIntent = new Intent(context,YourActivityClassHere.class);
notifyIntent.setFlag(Intent.FLAG_ACTIVITY_NEW_TASK);
//UNIQUE_ID if you expect more than one notification to appear
PendingIntent intent = PendingIntent.getActivity(SimpleNotification.this, UNIQUE_ID,
notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT);
只需使PendingIntent打开您的活动之一,并使您的活动完全透明并打开一个对话框即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.