Привет команды я столкнулся вопрос в уведомлении backstackAndroid уведомление навигации backstack
говорит, у меня есть 4 действия A1, A2, A3, A4
У меня есть уведомление, которое намерение A2, предположу, представьте себе, что мы находимся в формате A4, перешли через A1 -> A2 -> A3 -> A4, теперь получаем уведомление, а при прослушивании уведомлений я намерен использовать A3, когда я возвращаюсь в этот сценарий, мой навигационный стек был очищен, и приложение закрывается.
Но мое ожидаемое поведение в этом случае был он должен идти к A4 и A3, A2, A1 на кнопку подложки прижимного
код
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context);
mBuilder.setSmallIcon(R.mipmap.ic_launcher);
mBuilder.setContentTitle("Notification Alert, Click Me!");
mBuilder.setContentText("Hi, This is Android Notification Detail!");
Intent resultIntent = new Intent(context, SecondActivity.class);
resultIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
stackBuilder.addParentStack(FirstActivity.class);
// Adds the Intent that starts the Activity to the top of the stack
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
//PendingIntent resultPendingIntent = PendingIntent.getActivity(context,0,resultIntent,PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(resultPendingIntent);
NotificationManager mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
// notificationID allows you to update the notification later on.
mNotificationManager.notify(14, mBuilder.build());
файл манифеста
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".FirstActivity" >
</activity>
<activity
android:name=".SecondActivity"
android:label="@string/title_activity_second"
android:parentActivityName=".FirstActivity"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
<activity
android:name=".ThirdActivity"
android:label="@string/title_activity_third"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
</application>
показать нам свой код создания уведомлений и ваш AndroidManifest.xml –