设置一个Android通知图标到远程网址 [英] Setting an Android Notification Icon to a remote URL
问题描述
我尝试使用远程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.
这篇关于设置一个Android通知图标到远程网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!