android - Change PendingIntent action at run time when click on notification -


i have integrated push notification in app, working on rite now, doing setting pendingintent currenttopactivity class of app if app in foreground state, if app in background state setting homeactivity class default class open homeactivity on notification click. setting notification setautocancel(fasle); make notification remain in notification area.

the problem is: if got notification , on thirdactivity.class sets thirdactivity.class in pendingintent open on notification click @ first time if second time user clicks on notification should not open thirdactivity instead should open homeactivity when user clicks on notification second time.

setting class classstring fetched depending on state of app described earlier:

intent notificationintent = new intent();         notificationintent.setclassname(context, classstring); 

so how can change pendingintent @ run time after user have clicked first time.

set pending intent send broadcast. receive in <receiver> , receiver choose activity launch depending on state.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -