由网友(繁华落尽)分享简介:我工作的机器人。试图显示图标(又名快捷方式图标)或网页。I am working on Android. Trying to display the "favicon" (aka "shortcut icon") or web pages.所以,我已经有code得到来自任何网站的这个图标的网址,并下载到我的机器人。...
我工作的机器人。试图显示图标(又名快捷方式图标)或网页。
I am working on Android. Trying to display the "favicon" (aka "shortcut icon") or web pages.
所以,我已经有code得到来自任何网站的这个图标的网址,并下载到我的机器人。
So I already have the code to get the URL of this icon from any website, and download it onto my Android.
现在我想做一个位图出来,但总是得到null作为结果。
Now I am trying to make a Bitmap out of it, but always get null as a result.
在code:
String src = String.format("file:///data/data/com.intuitiveui.android/files/%s",prefName);
// prefName is "facebook.ico", and I do see tht file in my DDMS file browser. It's
// a valid icon file.
Bitmap res = BitmapFactory.decodeFile(src);
// This returns null
TIA
推荐答案
下面是的支持的Android的媒体格式。 ICO不在其中。你也许可以找到一个基于Java的ICO德codeR,虽然。
Here is a list of the supported Android media formats. ICO is not among them. You might be able to find a Java-based ICO decoder, though.
相关推荐
最新文章