android - strange behavior when starting activity from notification -


i using parse send notification android phones , when receive push generate notification using below function.

private void generatenotification(context context, string title, intent intent, boolean hassound) {     int notification_id = ("onccent" + system.currenttimemillis()).hashcode();     pendingintent contentintent = pendingintent.getactivity(context, notification_id, intent, pendingintent.flag_update_current);     notificationmanager mnotifm = (notificationmanager) context.getsystemservice(context.notification_service);      notificationcompat.builder mbuilder = new notificationcompat.builder(context).setsmallicon(r.drawable.ic_launcher).setcontenttitle(context.getstring(r.string.app_name)).setcontenttext(title);     mbuilder.setautocancel(true);     mbuilder.setcontentintent(contentintent);     if (!hassound) {         mbuilder.setdefaults(notification.default_sound);     }     mnotifm.notify(notification_id, mbuilder.build());  } 

the intent intent of activity displaying messages , let's call activity b. use activity represent home activity.

the problem is: when exists, things work well. when click notification, stack becomes

a -> b1 

and click another:

a -> b1 -> b2 

this expect. however, when kill whole app , click on first notification. open b following notification bring app front without open new b.

it seems not work without a. manage open first if not exist in stack define parent activity of b. notification works seems previous activity goes away.

how can solve this? in short, want new activity open when click on notification.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -