怎么为每个应用程序图标设置不同的背景图? 比如说,在手机桌面上有些应用程序的图标背景是空白图片,或者是方格图片,或者不同颜色的背景图,我现在是想每个应用程序图标能随机选择不同的背景图,不知道能否做到?求高手指导啊!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 问题已解决,csdn上回复的人太少了! Launcher.java (packages\apps\launcher2\src\com\android\launcher2):private void initialIconBackgroundBitmap() 加上下面语句 int[] iconBgBimap = new int[] {R.drawable.icon_background_blue, R.drawable.icon_background_green, R.drawable.icon_background_indigo, R.drawable.icon_background_orange, R.drawable.icon_background_purple, R.drawable.icon_background_red, R.drawable.icon_background_yellow}; for( int i = 0; i < Launcher.INITIAL_ICON_BACKGROUND_CAPACITY; i++ ) { Bitmap iconBgBitmap = BitmapFactory.decodeResource(getResources(), iconBgBimap[i]); mIconBackgroundBitmap[i] = iconBgBitmap; } 楼上是在csdn上第一个回复我的人,呵呵..很荣幸啊,望以后能相互交流 楼主你的这段代码完整么? 我看Launcher2工程中的laucher.java已经包含有此方法,并且函数内容也一样 是吗!那我感到非常荣幸!我也是android初学者,以后大家互相帮助,互相交流 这个很简单的.设置 icon 背景就好了 .2个会叠在一起. 你随即换几张就ok了. listview 异步加载网络图片问题 Valid ABIs: no ABIs ABI的问题 让几张图片同时隐藏 选项卡的实现中Framelayout怎么布局控件? 客户端Android接图片问题.急急急 接收不到listview的id。。。我去!!! 怎样将一个程序切换至前台? android-ndk环境配置问题 求大神解救阿 求抱大腿阿 快来看看吧 是不是每个BroadcastReceiver都需要在xml中配置的 新浪微博开放平台oauth2.0授权后如何重新让用户授权? 如何在菜单事件里面保存onActivityResult()回传的数据
!
加上下面语句
int[] iconBgBimap = new int[] {R.drawable.icon_background_blue, R.drawable.icon_background_green, R.drawable.icon_background_indigo,
R.drawable.icon_background_orange, R.drawable.icon_background_purple, R.drawable.icon_background_red, R.drawable.icon_background_yellow};
for( int i = 0; i < Launcher.INITIAL_ICON_BACKGROUND_CAPACITY; i++ ) {
Bitmap iconBgBitmap = BitmapFactory.decodeResource(getResources(), iconBgBimap[i]);
mIconBackgroundBitmap[i] = iconBgBitmap;
}
是吗!那我感到非常荣幸!
我也是android初学者,以后大家互相帮助,互相交流
设置 icon 背景就好了 .
2个会叠在一起.
你随即换几张就ok了.