-1
My Firebasemessagingservice Klassencode für das Bestehen Absicht:Wie Fragment auf Klick von Push-Benachrichtigung öffnen
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());
}
Mein Fragment BaseActivity Code in onCreate() -Methode:
Intent notifyIntent = getIntent();
Bundle extras = notifyIntent.getExtras();
if (extras != null) {
replacefragment code;
}
Es funktioniert nicht ..
pls post ersetzen Fragment-Code auch. Und bearbeiten Sie Frage, um es richtig zu erwähnen, was Sie erreichen möchten –
Was ist das Problem, stellen Sie bitte eine Frage ... sehen Sie [fragen] und erklären Sie Problem – AxelH
Überschreiben Sie 'NewIntent()' Methode in Ihrer Tätigkeit und rufen Sie Fragment von ihm auf. – Piyush