How to apply a big view style to a notification using Parse library

前端 未结 8 966
孤街浪徒
孤街浪徒 2021-02-04 06:03

This library works perfectly, but i have a doubt.

When I send a message to users with more than two lines, users can\'t see all message in notification area.

But

8条回答
  •  不要未来只要你来
    2021-02-04 06:41

    final String someLongText = "......";
    
    final Notification.Builder builder = new Notification.Builder(this);
    builder.setStyle(new Notification.BigTextStyle(builder)
            .bigText(someLongText)
            .setBigContentTitle("Big title")
            .setSummaryText("Big summary"))
            .setContentTitle("Title")
            .setContentText("Summary");
    
    final NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    nm.notify(0, builder.build());
    

提交回复
热议问题