Short answer The limit is 5120 characters (5 KB), but you do not need to limit your messages. This is done for you on the builder.
Detailed answer
In your code, you are using NotificationCompat.BigTextStyle , which uses NotificationCompat.Builder .
This happens when you call setBigContentTitle
public BigTextStyle setBigContentTitle(CharSequence title) { mBigContentTitle = Builder.limitCharSequenceLength(title); return this; }
The limitCharSequenceLength function does this.
protected static CharSequence limitCharSequenceLength(CharSequence cs) { if (cs == null) return cs; if (cs.length() > MAX_CHARSEQUENCE_LENGTH) { cs = cs.subSequence(0, MAX_CHARSEQUENCE_LENGTH); } return cs; }
And if we check the declaration of the constant, we find it
private static final int MAX_CHARSEQUENCE_LENGTH = 5 * 1024;
source share