Android NotificationListenerService onNotificationPosted fire twice

后端 未结 5 951
情深已故
情深已故 2021-01-18 12:35

I listen for notifications like WhatsApp Messages.

But every time a notification comes in the NotificationListenerService fire twice.

Does anyone know this p

5条回答
  •  [愿得一人]
    2021-01-18 13:26

    Using Split you can achieve this thing.

     String[] separated = Your Notification key.split("\\|");
        if (!separated[3].equalsIgnoreCase("null")){//Add Your Data in list or DB }
    

提交回复
热议问题