java - Resuming current background activity on notification -


my application contains multiple activities. have implemented push notifications , shown notification in bar. issue is, when click on notification take me specific activity has specified.

    intent intent =new intent(gcmservice.this, mainactivity.class);      pendingintent pendingintent = pendingintent.getactivity(gcmservice.this, 0, intent, 0);      notificationcompat.builder notificationbuilder = new notificationcompat.builder(             getapplicationcontext())             .setcontenttitle(getresources().getstring(r.string.app_name))             .setautocancel(true)             .setcontentintent(pendingintent);      notificationbuilder.setcontentintent(pendingintent);     mnotificationmanager.notify((int) when, notificationbuilder.build()); 

i want if activity in background, , user click on notification app resume current activity in background , show dialog box. , if application closed. open launching activity , show dialog box.

if want continue again when click notification(in case application still running on background) can using method : http://developer.android.com/training/basics/activity-lifecycle/stopping.html

i've tried , works.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -