android - Using an application's notification to invoke another application/activity -


how can use application's notification start new application. notificationmanager not provide me method lets me access generated notifications. suggestions? thanks.

you have create notification pendingintent. android developers:

context context = getapplicationcontext(); charsequence contenttitle = "my notification"; charsequence contenttext = "hello world!"; intent notificationintent = new intent(this, myclass.class); pendingintent contentintent = pendingintent.getactivity(this, 0, notificationintent, 0); notification.setlatesteventinfo(context, contenttitle, contenttext, contentintent); private static final int hello_id = 1; mnotificationmanager.notify(hello_id, notification); 

where myclass activity want start notification.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -