简体   繁体   中英

How to show/call different-different activities from status notification bar in android

I have an app which has 3 dashboard items as an activity. So whenever there is an notification in status bar and clicked it should call that respective activity.

I know how to create notifications but i am stuck for calling respective activities on notifications. Also is there a way to differentiate a notification based on activities..?

Help Appreciated.

Intent notificationIntent = new Intent(context, [packagename]);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
mNotificationManager.notify(HELLO_ID, notification);   

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM