正如您从这张图片中看到的那样,我想在红色圆圈内创建它。如何在通知栏中创建文本?这是图片: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);
谢谢