Follow the steps Hope this helps you
1) Create a BroadCastReceiver
public class MyBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// Start Activity
// Start Services
}
}
2) Just Fire Broadcast on notification click.
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Intent intent = new Intent(context, MyBroadcastReceiver.class);
PendingIntent contentIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
Notification notification = new Notification(icon, ticker, when);
notification.setLatestEventInfo(mSmartAndroidActivity, title, message, contentIntent);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(0, notification);
Use PendingIntent.getBroadcast
instead of PendingIntent.getActivity
3) In BroadcastReceiver's onReceive() method
-> call your third party activity
-> Start services