I'm working on android app that lets users switch to google navigation. I've been asked to get users a solution to get back to the app without scrolling through list of open apps. I found the way to draw a button on top of everything but am struggling to get nice flow with activity life-cycle.
If user gets back to the app through manually selecting my app in list of existing apps - my app starts with onResume, However if i force my app to get back via service button it is starting with onCreate and all unsaved data i had withing my activity is getting lost.
This is the code i use to call activity back via service and button
Intent myIntent = new Intent ( getApplicationContext(), PhoneView.class );
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
myIntent.addFlags(Intent.FLAG_FROM_BACKGROUND);
getApplicationContext().startActivity(myIntent);
I think i can putExtra bool in this call from Service and before i let user off my activity - i can save all the fields and recreate it back, but it feels like to much of extra work..
Is there a way to call my app from service and have it use existing activity, rather than to go through onCreate again assuming i know that my activity is running?