关于android4.0的launcher2源码修改,编译运行的错误,求指导 把源码导入eclipse中,编译通过,运行会出现没有bind_widget权限,然后往往很多博客说用adb命令将apk放到系统app文件夹下,然后没有缺少权限的异常了,又重新说没有Resources.getDrawableForDens方法,但是这个方法明明存在,不知道该怎么解决了,求大神指导 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 getDrawableForDens这个方法你自己加的吗?自己加的你就得编译那个模块,并push进去 不是啊,是android.jar包中本来就有的,如图: 编译通过说明能找到这个方法的引用,可以贴出Log? public Drawable getFullResIcon(Resources resources, int iconId) { Drawable d; try { d = resources.getDrawableForDensity(iconId, mIconDpi); } catch (Resources.NotFoundException e) { d = null; } return (d != null) ? d : getFullResDefaultActivityIcon(); }你的android测试机运行版本是多少的?这个函数是Added in API level 15;http://developer.android.com/reference/android/content/res/Resources.html#getDrawableForDensity%28int,%20int%29 public Drawable getFullResIcon(Resources resources, int iconId) { Drawable d; try { d = resources.getDrawableForDensity(iconId, mIconDpi); } catch (Resources.NotFoundException e) { d = null; } return (d != null) ? d : getFullResDefaultActivityIcon(); }你的android测试机运行版本是多少的?这个函数是Added in API level 15;http://developer.android.com/reference/android/content/res/Resources.html#getDrawableForDensity%28int,%20int%29嗯 谢谢你 问题解决了,确实是版本的问题 Android NDK 编译ffmpeg出错,求解 Ubuntu(64bit)如何安装arm-eabi-gcc v4.43安装包 怎么遍历出集合里面的 数字啊? 【求助】软件实现触屏操作 android流量统计问题 android 光热感应 手机装入口袋自动检测 BREW和Android的安全思想 Android客户端http服务器连接出问题 【求助】 Error:java.lang.NullPointerException 问题求助 《Android 开发入门与实战 》 这本书的源代码谁有啊?, 有没有做机顶盒开发的大神,我想请教几个问题,希望能帮助一下
public Drawable getFullResIcon(Resources resources, int iconId) {
Drawable d;
try {
d = resources.getDrawableForDensity(iconId, mIconDpi);
} catch (Resources.NotFoundException e) {
d = null;
} return (d != null) ? d : getFullResDefaultActivityIcon();
}你的android测试机运行版本是多少的?这个函数是Added in API level 15;
http://developer.android.com/reference/android/content/res/Resources.html#getDrawableForDensity%28int,%20int%29
public Drawable getFullResIcon(Resources resources, int iconId) {
Drawable d;
try {
d = resources.getDrawableForDensity(iconId, mIconDpi);
} catch (Resources.NotFoundException e) {
d = null;
} return (d != null) ? d : getFullResDefaultActivityIcon();
}你的android测试机运行版本是多少的?这个函数是Added in API level 15;
http://developer.android.com/reference/android/content/res/Resources.html#getDrawableForDensity%28int,%20int%29
嗯 谢谢你 问题解决了,确实是版本的问题