Update NotificationListener.java
parent
21dc14ba5f
commit
c416971d67
|
|
@ -46,7 +46,8 @@ public class NotificationListener extends NotificationListenerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
Bundle extras = sbn.getNotification().extras;
|
Bundle extras = sbn.getNotification().extras;
|
||||||
String title = extras.getString(Notification.EXTRA_TITLE);
|
CharSequence titleCharSequence = extras.getCharSequence(Notification.EXTRA_TITLE);
|
||||||
|
String title = titleCharSequence != null ? titleCharSequence.toString() : null;
|
||||||
String content = extras.getString(Notification.EXTRA_TEXT);
|
String content = extras.getString(Notification.EXTRA_TEXT);
|
||||||
String tickerText = sbn.getNotification().tickerText != null ? sbn.getNotification().tickerText.toString() : "";
|
String tickerText = sbn.getNotification().tickerText != null ? sbn.getNotification().tickerText.toString() : "";
|
||||||
String logMessage = String.format("packageName: %s,title: %s,content: %s,tickerText: %s", packageName, title, content, tickerText);
|
String logMessage = String.format("packageName: %s,title: %s,content: %s,tickerText: %s", packageName, title, content, tickerText);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue