Is possible set Expanded Notification as default in Big Text Notifications? –

Development issue/problem:

I followed this example code

In the Large Text Notifications section, indicate that a large text notification form should be displayed, as shown in the image below:

Interestingly, we cannot set the default advanced notification in Big Text? mode notifications.

The people who know, can’t or shouldn’t,

If you don’t mind my saying so,

Please, tell me how to do this,

Thank you!

How can I solve this problem?

Solution 1:

The documentation states :

The large notification display is displayed only when the notification is expanded
, which happens when the notification is at the top of the
notification panel, or when the user gestures to expand the
notification.

So my answer is this: No, you can’t extend it by default.

However, there is a trick to getting the notification to the top of the list where it is expanded. Just set the priority to Notification.PRIORITY_MAX and chances are your request will be at the top of the list.

Solution 2:

Notification noti = new notification.Builder()
… // Same notification properties as the other
.setStyle(new Notification.bigPictureStyle().bigPicture(mBitmap))
.build() ;

They change.

.setStyle(new NotificationCompat.BigTextStyle().bigText(th_alert))

Notification

notification = new NotificationCompat.Builder(context)

Here’s an example:

Enter the description of the image You can set the code here

Intent = new intent (context, ReserveStatusActivity.class);
PendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
NotificationManager notificationManager =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Intent = new Intent(String).valueOf(PushActivity.class));
int.putExtra(message, MESSAGE);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
stackBuilder.addParentStack(PushActivity). ;
stackBuilder.addNextIntent(intent) ;
// PendingIntent pendingIntent =
stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT) ;

// android.support.v4.app.notificationCompat.bigTextStyle bigStyle = new context NotificationCompat.bigTextStyle();
// bigStyle.bigText((CharSequence))

notify = new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(th_title)
.setContentText(th_alert)
.setAutoCancel(true)
// ..setStyle(new Notification.BigTextStyle().bigText(th_alert) ตัวเก่า
// .setStyle(new NotificationCompat.BigTextStyle().bigText(th_title))
.setStyle(new NotificationCompat.BigTextStyle().bigText(th_alert))
.setContentIntent(pendingIntent)
.setNumber(++numMessages)
.build() ;

notification.sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION) ;
notificationManager.notification(1000, notification) ;

Solution 3:

notificationBuilder.setStyle(new NotificationCompat.bigTextStyle().bigText(your long text here))

Just set up your notification generator.

Solution 4:

If you are using Push Notification V5, you do not need to make any changes to the file to display multiple lines of the notification, you just need to remove the style field of the sent object. Different message rules are automatically visible. For more information, vote for an answer, ask your question. Let me help you.

For your information, please find this issue

Solution no. 5:

From this notification code you have images and text in large print or larger.

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context);
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mBuilder.setSmallIcon(R.drawable.small_logo) ;
mBuilder.setColor(Color.parseColor(#D74F4F)) ;
} else {
mBuilder.setSmallIcon(icon) ;
}

mBuilder.setTicker(title).setWhen(when);
mBuilder.setAutoCancel(true);
mBuilder.setContentTitle(title);
mBuilder.setContentIntent(intent);
mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
mBuilder.setLargeIcon(BitmapFactory.decodeResource(context).getResources(), icon));
mBuilder.setContentText(msg);
mBuilder.setPriority(Notification.PRIORITY_MAX);
if (Utilities.validateString(banner_path)) {
mBuilder.setStyle(notiStyle);
} else {
mBuilder.setStyle(new NotificationCompat.bigTextStyle().bigText(msg));
}

Notification noti = mBuilder.build();
notificationManager.notify(0, noti) ;

Good luck!

Related Tags:

 notification with image androidandroid notification stylescustom expandable notification androidandroid show push notificationandroid notification text cut offbigpicturestyleandroid collapse notificationsnotification set style androidcreate the notification expandable android application project for screenshotandroid expand notification programmaticallyandroid notifications always expandedandroid multiline notificationandroid notification large iconinbox style notification android

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *