Skip to content
Advertisement

Spannabe String text from Bundle getExtras

In my notification listener, I m not able to get value for keyvalue [android.text] when the notifications are received from gmail. It is working fine for most of notifications, but for gmail, it throws exception as below.

JavaScript

Below is how i m fetching value of text

JavaScript

since we do not have any method for extracting SpannableString from bundle, can someone help to handle this.

Advertisement

Answer

just try this–>

String rawmessage = bundle.getCharSequence("android.text");

Or try it like this–>

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement