Android Notification Action is not fired (PendingIntent)

前端 未结 9 1501
盖世英雄少女心
盖世英雄少女心 2020-12-30 02:39

I am trying to add an Notification action item in my app which is a music player. When a stream is started a notification should be triggered and an stop button for the stre

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 03:00

    I find solution in this thread on google code https://code.google.com/p/android/issues/detail?id=61850

    To fix it you must add PendingIntent.FLAG_CANCEL_CURRENT flag to your PendingIntent.

    PendingIntent stopPendingIntent2 = PendingIntent.getBroadcast(this, 0,
                stopIntent2, PendingIntent.FLAG_CANCEL_CURRENT);
    

提交回复
热议问题