Update NotificationListener.java
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user