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 n
I found a shorter way of accessing the expanded notification. This works in API 24.
If you are getting null while accessing getCharSequence("android.textLines"), this is because it actually returns an array of CharSequence as rightly pointed out by Puneet above.
So rather access them like this:
if (extras.getCharSequenceArray("android.textLines") != null)
text = Arrays.toString(extras.getCharSequenceArray("android.textLines"));