我的未决意图无法正常工作。
问题是:点击通知时,它会重定向到Splash Activity,这是我的启动器应用程序活动,以下是我创建通知的代码。
Intent intent = new Intent(this, QuickTasks.class).putExtra("NOTIFICATION", 1);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent resultIntent = PendingIntent.getActivity(this, 0, intent,
PendingIntent.FLAG_ONE_SHOT);
Uri notificationSoundURI = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder mNotificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("Suvi")
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(notificationSoundURI)
.setContentIntent(resultIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, mNotificationBuilder.build());
请帮助我,在这方面我已经使用了很多可用的资源,但都没有工作。任何帮助都可能是值得的。感谢Advacne
答案 0 :(得分:0)
通常,当您要从通知中开始活动时,有两种情况:
请参考以下链接。
Preserving Navigation when Starting an Activity
希望对您有帮助。