Fixed warnings in logs for formatted notifications

This commit is contained in:
2025-05-01 16:07:22 +02:00
parent f04c517c80
commit e8524f719f
2 changed files with 4 additions and 3 deletions

View File

@ -146,13 +146,13 @@ public class NotificationListener extends NotificationListenerService// implemen
try
{
if (extras.containsKey(EXTRA_TEXT))
text = extras.getString(EXTRA_TEXT).toString();
text = String.valueOf(extras.getCharSequence(EXTRA_TEXT));
}
catch (NullPointerException e)
{
// in stacked notifications the "surrounding" element has no text, only a title
if (extras.containsKey(EXTRA_TEXT) && extras.get(EXTRA_TEXT) != null)
text = extras.get(EXTRA_TEXT).toString();
text = String.valueOf(extras.getCharSequence(EXTRA_TEXT));
}
SimpleNotification returnNotification = new SimpleNotification();