title: android - return to app from service or notification
body: <p>i'm having some problems with the flow of an app i'm working on. 
  basically , i have a service that always holds a notification , pressing on the notification should return to the app's most recent activity , without re-opening it (meaning that it will resume).
  also , on a specific activity (and maybe others ) , i need that clicking on the back button would exit the app (and the service) , so the next time the end user starts it via the launcher or via long pressing the home button , it will go back to the first activity .</p>
  
  <p>in short , the requirements are:</p>
  
  <ul>
  <li>service notification click -> resume current activity , no creation of new activity.</li>
  <li>back click on a specific activity -> close app entirely (clearing all app's stacks).</li>
  </ul>
  
  <p>so , for example , if i have activity A which calls activity B (which is the special activity) :
  if the end user has clicked home , and then returned to the app via the notification (or launched via launcher/long press on home button) , it will return to the exact state of activity B that he left it .
  also , if the end user has pressed the back button on activity B , the app is closed (and the service and notifications shall be gone) the next time he opens the app (no matter how) , he will go back to activity A .</p>
  
  <p>i've tried to use "singleInstance" on activity B , but then it will always get back to activity B , since it is inside its own task , no matter which flags i use(i have tried  FLAG_ACTIVITY_REORDER_TO_FRONT and some other flags) . 
  without using it , the notification will open a new instance of activity B .</p>
  
  <p>can anyone please help ?</p>