¿Es posible configurar la notificación ampliada como predeterminada en las notificaciones de texto grande?

He seguido este ejemplo de código

En la sección de Big Text Notifications , dijo que la necesidad de ampliar para ver la forma de Big text notification , como imagen im a continuación:

Introduzca aquí la descripción de la imagen

Me pregunto que no podemos set Expanded Notification as default in Big Text Notifications?

La gente que lo sabe es puede o no,

Si puede,

Por favor, dime cómo hacerlo,

Gracias,

La documentación establece :

La vista grande de una notificación aparece sólo cuando se amplía la notificación, lo que ocurre cuando la notificación se encuentra en la parte superior del cajón de notificaciones o cuando el usuario expande la notificación con un gesto.

Así que mi respuesta es no, no se puede ampliar por defecto.

Sin embargo, hay un truco para empujar la notificación a la parte superior de la lista donde se ampliará. Simplemente establezca la prioridad de Notification.PRIORITY_MAX y es probable que la notificación de su aplicación llegue a la parte superior.

 Notification noti = new Notification.Builder() ... // The same notification properties as the others .setStyle(new Notification.BigPictureStyle().bigPicture(mBitmap)) .build(); 

Tú cambias

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

Junto con el anuncio

 notification = new NotificationCompat.Builder(context) 

Aquí hay un ejemplo:

Introduzca aquí la descripción de la imagen Puede configurar Código

 Intent intent = new Intent(context, ReserveStatusActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); intent = new Intent(String.valueOf(PushActivity.class)); intent.putExtra("message", MESSAGE); TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); stackBuilder.addParentStack(PushActivity.class); stackBuilder.addNextIntent(intent); // PendingIntent pendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); // android.support.v4.app.NotificationCompat.BigTextStyle bigStyle = new NotificationCompat.BigTextStyle(); // bigStyle.bigText((CharSequence) context); notification = 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.notify(1000, notification); 
  • ¿Cómo obtener un notificador de aplicación PERMANENTE en la barra de estado?
  • Volver a iniciar la aplicación Android cuando el usuario hace clic en la notificación de Dirigible urbano
  • Mostrar icono pequeño en la barra de estado sin mostrar notificación
  • ¿Cómo obtener el color de fondo de notificación predeterminado para la notificación personalizada en Lollipop?
  • NameError: uninitialized constant Rpush :: Gcm Estoy intentando usar rpush para mi aplicación móvil. Pero sigo recibiendo este error
  • ¿Cómo hacer un icono en la barra de acción con el número de notificación?
  • Agregar una notificación nueva cuando recibe notificación push (no reemplaza la antigua)
  • Saber si la aplicación recibió la notificación desde el lado del servidor
  • Colapso de notificaciones nuevas de Jelly Bean por defecto
  • Android: descarga el archivo desde el servidor y muestra el progreso de la descarga en la barra de notificación mediante AsyncTask
  • Notificación push en Amazon Android
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.