Android notifications actions without opening the app

后端 未结 3 1930
迷失自我
迷失自我 2020-12-31 04:40

I want to implement a notification action in JB. But it shouldn\'t open the app. The behaviour is similar to the Gmail apps delete notification action. How can I do this?

3条回答
  •  被撕碎了的回忆
    2020-12-31 05:34

    From what I understand of what your asking, you need to run a AlarmManager that launches background services at specified times to create notifications, and then you need to specify the intent for the notification to do what you want it to do.

    If you are getting Push notifications, then forget the AlarmManager and just launch the action you want to do from the intent in the notification.

    For more specific answer we need a more specific question.

提交回复
热议问题