开发者

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

I cannot see how to start bot开发者_如何学编程h when user click a Notification.


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.


If you don't want to mess with your current activity you can create another activity "A" that starts your activity "B" and your service and start the activity A from the pending intent

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜