Read full text of Android Notifications?
-
27-10-2019 - |
Question
I'm looking for a way to read the full text of a notification, because notifications with large amount of text are getting cropped:
Is it possible to force notification bar to expand to fit the text? Of maybe there is a way to access the log of them somewhere?
I've seen people asking how to display notification with longer texts without any luck:
Android multiline notifications / notifications with longer text
Isn't there really no way to even read them without getting to the app that triggered them?
Solution
I haven't done it, but I believe if you specify a RemoveViews when creating your notification, you can specify the view to use when displaying the notification. You may be able to use that to make one that expands beyond the current default size.
See http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomNotification
OTHER TIPS
Hey i have been searching around too and found forums with people saying you have to use the trackball or arrows to highlight it and longpressing doesnt work. But after a while i got fed up and was about to give up and decided to try a long press one more time and it works!!! Lol you have to longpress and hold for a good 5 seconds
Try this,
Notification notification = new Notification.Builder(currentContext)
.setSmallIcon(R.drawable.ic_launcher)
.setStyle(
new Notification.BigTextStyle()
.bigText(
"Your lengthy text here")
.setBigContentTitle("Your title!!!")
.setSummaryText("Wonderful summary here"))
.setAutoCancel(true).setContentIntent(pendingIntent).build();
notification.defaults |= Notification.DEFAULT_SOUND;
notification.defaults |= Notification.DEFAULT_LIGHTS;
notificationManager.notify(NOTIFICATION_ID, notification);
Above code that I've used, shows entire text without truncating. I've used it in apps with minimum sdk 4.4.2 and works fine.
It seems there is a limit for height of custom notification views. This answer says the limit is 65 sp
. Worst part is the offical documentation did not mentioned it anywhere.
https://stackoverflow.com/a/29364414/1025379
sbn.getNotification().extras.getCharSequence(Notification.EXTRA_TEXT).toString();