4

I have couple of questions regarding deep linking in conjunction with up navigation.

In my application there is following hierarchy of activities:

HomeActivity  ->  ItemListActivity  ->  ItemDetailActivity

With deep linking (user clicks on a url from browser, email client etc) user may directly go to the ItemDetailActivity.

In normal flow as shown above the back and up navigation will be exactly the same.

But if ItemDetailActivity is opened via deep linking what should be the up navigation flow? Should it just behave like back and go to the starting activity or it should go to the HomeActivity? As far as I know up navigation should remain in the app and it can not go to ItemListActivity as search criteria to show item list is not known hence to HomeScreen.

Also I want the launchMode of ItemDetailActivity to be singleTask.

Abdullah
  • 7,143
  • 6
  • 25
  • 41

1 Answers1

4

If you want to follow the guidelines -
After usage of the deep link:

  • Up from the Detail Screen will get you to the List View (where the Detail item should be contained)
  • Back will close the app and get the user to where they were before.

Providing correct back navigation is important and needed to be indexable by google, since failing to getting back will cause a crawl error.

Very little applications provide correct Up navigation, though.
Even very popular apps don't follow the guidelines and/or do their own thing.

So, if possible, you should always try and stick with the guidelines, but if it is not possible or very hard to do so, they are guidelines, not rules, and you can do whichever you think is best.

David Medenjak
  • 33,993
  • 14
  • 106
  • 134
  • 2
    The guidelines are a bit confusing in this regard. From one hand the document specify: "The Up button is used to navigate within an app based on the hierarchical relationships between screens... The system Back button is used to navigate, in reverse chronological order, through the history of screens the user has recently worked with ..." On the other hand the document specify: "In the case of the Back button, you should make navigation more predictable by inserting into the task's back stack the complete upward navigation path to the app's topmost screen" – ifeins Jan 30 '18 at 09:34