Android: Listen for notification update -
is there way listen if notification updated. example if receive message in messenger notification listener notice that, once receive second message - notification listener ignores that.
i have tried cancelling notifications, did not work
my notification listener:
public class reader extends notificationlistenerservice{ @override public void onnotificationposted(statusbarnotification sbn) { string pack = sbn.getpackagename(); int id = sbn.getid(); string ticker = sbn.getnotification().tickertext.tostring(); bundle extras = sbn.getnotification().extras; final string title = extras.getstring("android.title"); string tag = sbn.gettag(); int ides = extras.getint("android.id"); final string ss = extras.getstring("android.text").tostring(); final string text = ss.tolowercase(); if (pack.equals("com.facebook.orca")) { string e = "tah"; log.e(e, pack); log.e(e, ticker); log.e(e, title); log.e(e, ss); intent msgrcv = new intent("msg"); msgrcv.putextra("package", pack); msgrcv.putextra("ticker", ticker); msgrcv.putextra("title", title); msgrcv.putextra("text", ">" + text + ""); localbroadcastmanager.getinstance(context).sendbroadcast(msgrcv); } }
Comments
Post a Comment