-1
我Firebasemessagingservice类代码:如何打开片段上的推送通知点击传球意图
private void showNotification(String message){
Intent intent=new Intent(this, DrawerActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("data", message);
PendingIntent pendingIntent=PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder builder=new NotificationCompat.Builder(this)
.setAutoCancel(true)
.setContentTitle("Registry")
.setContentText(message)
.setSmallIcon(R.drawable.com_facebook_button_send_icon_blue)
.setContentIntent(pendingIntent);
NotificationManager manager=(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.notify(0,builder.build());
}
我的片段BaseActivity代码onCreate()方法:
Intent notifyIntent = getIntent();
Bundle extras = notifyIntent.getExtras();
if (extras != null) {
replacefragment code;
}
这不起作用..
请发帖替换片段代码。并编辑问题,正确地提及它想要达到什么 –
有什么问题,请问一个问题...看到[问]并解释你的问题 – AxelH
覆盖您的活动中的'NewIntent()'方法并从它调用片段。 – Piyush