Home > Enterprise >  How to navigate back to app previous screen from Foreground Service(Button click)
How to navigate back to app previous screen from Foreground Service(Button click)

Time:03-11

I am launching YouTube with our floating window timer.

when time finishes, I want to come back to the app. Currently I am doing this by startIntent(MainActivity) but it open a fresh app that is an issue, I want to open previous opened fragment.

I used Single Activity Navigation Component Architecture in my App

CodePudding user response:

add flag in your intent

intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_SINGLE_TOP);
  • Related