I've implemented a notification listener to look out for a Gmail notification.
I want to collect the expanded text (bigtext) from the notification as shown in the notification below:
See "----Forwarded message---", etc. which only appears when the user expands the notification to show the action buttons.
This string value does not appear in the notification's "EXTRAS" data...
http://developer.android.com/reference/android/app/Notification.html
After viewing the above link, I further investigate the bundle (EXTRAS) data. When you debug it and look at the variable, you can find that all information regards the notification are stored in the bundle and you can get the detail by
notifyBundle.extras.getCharSequence("android.textLines")
for multi line notification and
notifyBundle.extras.getString("android.text")
for single line notification.
For more information, look at the variable in eclipse debugging mode
Image of variables in bundle for single line notification
Image of variables in bundle for multi line notification
Note: The extra bundle only available in API19 (Kitkat). I've never tried in device which lower than API19.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With