I want to resume my app from a status bar notification in the exact same manner as when the user taps its icon in the launcher.
That is: I want the stack to be in th
THE ULTIMATE SOLUTION: Notification to restore a task rather than a specific activity?
public class YourRootActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
if (!isTaskRoot()) // checks if this root activity is at root, if not, we presented it from notification and we are resuming the app from previous open state
{
val extras = intent.extras // do stuffs with extras.
finish();
return;
}
// OtherWise start the app as usual
}
}