Reputation: 1020
I am trying to use Backstack to handle navigation when opening my app via a deeplink. Basically, the deeplink opens a details page, and I want pressing Back to take the user to a home activity for the app.
val backstack = TaskStackBuilder
.create(context)
.addNextIntent(homeActivityIntent)
.addNextIntent(detailsPageIntent)
taskStackBuilder.startActivities()
On most devices this is working fine, however a few users (one example is a user running Android 14 on a Google Pixel 9) are seeing the home activity intent fire before the details page appear. This causes the home Activity to briefly open, firing its onCreate and creating its ViewModel. For business logic reasons I won't get into, this is causing some issues due to the home and detail activites opening within a few ms of each other. On the vast majority of devices I have tested, the home Activity is never launched at all until the user presses Back, which I understood to be the expected behaviour for this Backstack. I'm wondering if anyone can offer an explanation why this might be happening on certain devices?
Upvotes: 0
Views: 15