Clicking Android Notification Actions does not close Notification drawer

后端 未结 5 1730
谎友^
谎友^ 2020-12-13 08:23

I am adding a Notification to System bar using the NotificationCompat library. This Notification has two action buttons. Also, AutoCancel() propert

5条回答
  •  独厮守ぢ
    2020-12-13 09:13

    The android system collapses the notification drawer for you whenever you click on a notification and launch an activity or broadcast. I don't think there are any programmatic way to close the notification drawer by your code. I suggest that you check the intents that you pass to the notification builder and make sure that they are given correct reference intents. I think something inside the android notification manager is getting blocked due to the intent you provide. So far i have not seen the notification drawer staying open once the action is triggered from the notification. Just curious to know whether your target activity is having a semitransparent area where the previous activity is visible, if it is then i suggest you make the background completely opaque (having no transparent/semi transparent region). May be that is preventing the android home launcher to complete stop sequence and thus not letting launcher to close the notification drawer for you. Hope I was able to help you. All the best.

提交回复
热议问题