frisbee icon indicating copy to clipboard operation
frisbee copied to clipboard

Avoid circular navigation for Activities accessible via nav drawer

Open esoxjem opened this issue 9 years ago • 3 comments

This is to avoid circular navigation adding to stack: Home > GDE > Pulse > GDE > Home

esoxjem avatar Oct 06 '16 11:10 esoxjem

That's a really good problem that we have for a long time. Thanks for bringing that up.

I don't know if having singleTask is the best solution to that. We can also use Intent flags to do this. I guess we don't have to set it Manifest level.

tasomaniac avatar Oct 07 '16 19:10 tasomaniac

@tasomaniac I think flags should be used to override the default behaviour defined in the manifest. Also, if you look at gmail's behaviour, pressing back from any of the activities brings you home. Maybe we shouldn't add them to the backstack?

esoxjem avatar Oct 13 '16 12:10 esoxjem

Exactly, flags should be override the default behavior. And default behavior should not be singleTask in our case. These Activity's can potentially be launched by other screens like widgets notification etc. In those cases, new task should be created. Putting singleTask in Manifest makes it impossible.

But I agree with you about the behavior. It's bad. We should be more intelligent.

tasomaniac avatar Oct 13 '16 22:10 tasomaniac