Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deep linking and up navigation in Android

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.

like image 338
Abdullah Avatar asked Oct 16 '25 14:10

Abdullah


1 Answers

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.

like image 117
David Medenjak Avatar answered Oct 18 '25 20:10

David Medenjak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!