如何在冰淇淋三明治的通知栏上添加图片

时间:2012-02-15 16:36:45

标签: android android-4.0-ice-cream-sandwich

2 个答案:

答案 0 :(得分:0)

Notification notif = new Notification(R.drawable.stat_sample, tickerText,
            System.currentTimeMillis());

R.drawable.stat_sample指向您的图片。

此处有更多信息:http://developer.android.com/guide/topics/ui/notifiers/notifications.html

答案 1 :(得分:0)

我发现,你需要新的api for Android 3.0+新的通知,你可以设置任何drawable:)

 Notification noti = new Notification.Builder(mContext)
     .setContentTitle("New mail from " + sender.toString())
     .setContentText(subject)
     .setSmallIcon(R.drawable.new_mail)
     .setLargeIcon(aBitmap)
     .build();