-1

正如您从这张图片中看到的那样,我想在红色圆圈内创建它。如何在通知栏中创建文本?这是图片:http ://tinypic.com/view.php?pic=23hu5xd&s=6

这是我的通知

notificationBuilder = new NotificationCompat.Builder(context);

                notificationBuilder.setOngoing(true);
                notificationBuilder.setContentTitle("Battery Stats Informations");
                notificationBuilder.setContentText("Carica residua: " +level+"%" + " " + "Temperatura: " +temperature+ "°C");
                notificationBuilder.setTicker("Battery level " +level+ "%");
                notificationBuilder.setWhen(System.currentTimeMillis());
                notificationBuilder.setSmallIcon(R.drawable.icon_small_not).setWhen(System.currentTimeMillis());
                Intent notificationIntent = new Intent(context, MainActivity.class);
                PendingIntent contentIntent = PendingIntent.getBroadcast(context, 0, notificationIntent, 0);
                notificationBuilder.setContentIntent(contentIntent);

                notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);

                Notification not=notificationBuilder.build();

                mNotificationManager.notify(SIMPLE_NOTIFICATION_ID,not);

谢谢

4

1 回答 1

0

有 N 个图标,一个用于您要显示的每个不同的“文本”,并在Notification.Builder setSmallIcon()通话中使用适当的图标。

IOW,您所看到的不是“文本”,而是“恰好有数字的图像”。

于 2013-08-14T22:56:13.960 回答