设置一个Android通知图标到远程网址图标、网址、通知、Android

由网友(浪花一朵朵)分享简介:我尝试使用远程URL(如图标)的通知图标,但是构造一个通知只接受一个资源ID(这是一个int),而不是无意义的东西像一个FileInputStream。我怎样才能既,定义在运行时流源新资源ID,或者下载一个图标,以我的资源,然后动态地获取资源ID?I'm try to use a remote URL (like a...

我尝试使用远程URL(如图标)的通知图标,但是构造一个通知只接受一个资源ID(这是一个int),而不是无意义的东西像一个FileInputStream。我怎样才能既,定义在运行时流源新资源ID,或者下载一个图标,以我的资源,然后动态地获取资源ID?

I'm try to use a remote URL (like a favicon) for a Notification Icon, however the Constructor for a Notification only accepts a resource id (which is an int), as opposed to something sensical like a FileInputStream. How can I either, define at runtime a new resource id for a stream source, or download an icon to my resources and then dynamically get a resource id?

推荐答案

由于API 11 Android已经不得不使用位图的的 largeIcon在通知中。这已经扩大甚至进一步果冻豆,让整个通知是图像,的 BigPictureStyle 。

Since API 11 Android has had the ability to use a Bitmap for a largeIcon in notifications. This has been expanded even further in Jelly Bean to allow entire notifications to be an image, BigPictureStyle.

阅读全文

相关推荐

最新文章