Questions tagged [taskstackbuilder]

Utility class for constructing synthetic back stacks for cross-task navigation on Android 3.0 and newer.

TaskStackBuilder provides a backward-compatible way to obey the correct conventions around cross-task navigation on the device's version of the platform. On devices running Android 3.0 or newer, calls to the startActivities() method or sending the PendingIntent generated by getPendingIntent(int, int) will construct the synthetic back stack as prescribed. On devices running older versions of the platform, these same calls will invoke the topmost activity in the supplied stack, ignoring the rest of the synthetic stack and allowing the back key to navigate back to the previous task.

35 questions
54
votes
2 answers

TaskStackBuilder transition animation

I'm using Android L transitions passing an ActivityOptions bundle in intent. How can I reproduce the animation on the same intent with TaskStackBuilder? This is my current working method with a single Intent: startActivity(myIntent,…
Giorgio Antonioli
  • 15,771
  • 10
  • 45
  • 70
46
votes
6 answers

Why do we use the TaskStackBuilder?

Why do we use the TaskStackBuilder when creating a notification? I do not get the logic behind it. Can someone please explain. public void showText(final String text){ Intent intent = new Intent (this, MainActivity.class); TaskStackBuilder…
MisterNowhere
  • 605
  • 1
  • 6
  • 13
17
votes
0 answers

Android TaskStackBuilder startActivities opens a white screen and freezes sometimes on Samsung Galaxy S3

I am getting a problem when trying to start an activity using the startActivities() method under TaskStackBuilder sometimes on some phones ( Specifically on Samsung Galaxy S3 - Android 4.3 , Samsung Galaxy S3 Neo - Android 4.4.2) Below is the code…
13
votes
0 answers

TaskStackBuilder.addParentStack not working when I was building a notification

I did everything as the official docs describes. But when I navigate backwards, the MainActivity(parent) doesn't open. Instead, the application closes. here is my code: Intent resultIntent = new Intent(context, TestActivity.class); TaskStackBuilder…
Allen Vork
  • 1,536
  • 3
  • 16
  • 29
9
votes
1 answer

TaskStackBuilder#startActivities() NullPointerException

I have a crash that keeps occurring on 4.4.2 and 4.4.3 devices (although I'm not sure this is an API issue), where in some ParsePushBroadcastReceiver the following code causes a NullPointerException somewhere deep inside the startActivities…
alex
  • 248
  • 2
  • 12
7
votes
1 answer

TaskStackBuilder with startActivityForResult

In my case I have an activity A that calls activity B using startActivityForResult. Activity B is a form that returns the data to activity A thus the data can be stored in my database. Moreover, my app launch a notification which starts activity B…
Alberto
  • 426
  • 6
  • 16
5
votes
1 answer

Android TaskStackBuilder ugly transition

What on earth is wrong with TaskStackBuilder that it uses this ugly transition when starting new activities.: TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(this) .addParentStack(ActivityB.class) …
drlobo
  • 2,139
  • 5
  • 32
  • 42
5
votes
2 answers

Using TaskStackBuilder in notification recreates an activity

I have a notification that is shown to the user when some event occur in the activity. When I create the notification, I use TaskStackBuilder to ensure that I have backstack activity list if my activities are cleared up by the system. My code it…
4
votes
1 answer

Build fragment backStack for push notification

I am using FCM to show a fragment when user tap on the notification from the status bar. Current app flow is this MainActivity(Fragment A -> Fragment B -> Fragment C). However when user tap a notification (whether app is running or not), I want to…
4
votes
3 answers

Unable to create back stack for activities

I am receiving a notification and i want to create a custom back stack so the user can navigate through it.But as of now clicking on the notification opens the desired activity but when i press the back button it completely exits the app. Intent…
4
votes
0 answers

Back button not working - TaskStackBuilder and AlarmManager for notification

I want to preserve the order of navigation, so I followed this: https://developer.android.com/guide/topics/ui/notifiers/notifications.html#NotificationResponse and this: Android - Build a notification, TaskStackBuilder.addParentStack not…
Minh Nghĩa
  • 854
  • 1
  • 11
  • 28
4
votes
2 answers

Start new activity from notification in existing task

My app receives pushes and opens different activities according to the push type. I use TaskStackBuilder for a pending Intent to create a synthetic backstack in conjunction with android:parentActivityNamein my manifest. So far, so easy. When the…
4
votes
3 answers

singleTop Activity sometimes being created even when on top of stack

I have an Activity whose launchMode is singleTop (in the manifest). My understanding is that if an Activity is singleTop and it is on top of the activity stack, then launching an the Activity with a new Intent will actually result in onNewIntent()…
3
votes
1 answer

Building a task stack for activity started after Firebase Notification

Using Firebase Cloud Messaging, when the app is in the background and a message has arrived, the message goes to the system tray. When the user than clicks on the notification, the app gets launched and the launcher activity gets the message data in…
3
votes
2 answers

TaskStackBuilder, multiple distinct PendingIntents, Notifications

I have problem with combination of TaskStackBuilder and distinct PendingIntents for notifications. Let me explain what it is about. I have an IntentService which creates notification when something comes up. Sometimes it creates several independent…
1
2 3