Search code examples
androidandroid-pendingintent

Can I start both an activity and a Service through a PendingIntent in the notification area


I cannot see how to start both when user click a Notification.


Solution

  • I think the answer is yes, but not directly.

    You can specify an extra to the intent whether to start the service and parse this extra in when your activity gets launched. The activity can start the service accordingly if needed.