有谁知道如何强加状态栏通知柜台蜂窝

我想使用的通知类的数场得到每个通知相关联“号事件”。 防爆。 如果我有两个未读邮件时,状态栏图标,邮件应该显示强加的电子邮件图标“2”。 我觉得这是工作的罚款与升级Froyo,但不知何故,我不能使其成为蜂窝工作。 这是我的代码看起来的样子

PendingIntent contentIntent; RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_notification_layout); Notification.Builder builder = new Notification.Builder(this); builder.getNotification().number = 2; builder.setSmallIcon(R.drawable.phone_missedcall); builder.setTicker("ABCD & Status : Missed Call"); notificationIntent = new Intent (this, NotificationSBActivity.class); contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); builder.setContentIntent(contentIntent); contentView = new RemoteViews(getPackageName(), R.layout.custom_notification_layout); contentView.setImageViewResource(R.id.contact_image, R.drawable.ic_contact_picture); contentView.setTextViewText(R.id.line_name, "Line 2: Cisco"); builder.setContent(contentView);

不过,这并不表明强加在图标上“2”。 是否有任何其他方式获得的蜂窝柜台? 此外,试图

int icon = R.drawable.phone_app; // icon from resources CharSequence tickerText = "Hello"; // ticker-text long when = System.currentTimeMillis(); // notification time Context context = getApplicationContext(); // application Context CharSequence contentTitle = "My notification"; // message title CharSequence contentText = "Hello World!"; // message text notificationIntent = new Intent(this, NotificationSBActivity.class); contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); // the next two lines initialize the Notification, using the configurations above Notification notification = new Notification(icon, tickerText, when); notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); notification.number = 2; mNotificationManager.notify(0, notification);

请让我知道,如果有人试图在Honeycomb通知柜台?

分类:安卓 时间:2015-03-15 人气:0
分享到:

相关文章

Copyright (C) 55228885.com, All Rights Reserved.

55228885 版权所有 京ICP备15002868号

processed in 0.542 (s). 10 q(s)