设置壁纸的代码在
Launcher.java中的case AddAdapter.ITEM_WALLPAPER: {
startWallpaper();
break;
}
中,
private void startWallpaper() {        closeAllApps(true);        final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);        Intent chooser = Intent.createChooser(pickWallpaper,                getText(R.string.chooser_wallpaper));        // NOTE: Adds a configure option to the chooser if the wallpaper supports it        //       Removed in Eclair MR1//        WallpaperManager wm = (WallpaperManager)//                getSystemService(Context.WALLPAPER_SERVICE);//        WallpaperInfo wi = wm.getWallpaperInfo();//        if (wi != null && wi.getSettingsActivity() != null) {//            LabeledIntent li = new LabeledIntent(getPackageName(),//                    R.string.configure_wallpaper, 0);//            li.setClassName(wi.getPackageName(), wi.getSettingsActivity());//            chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { li });//        }        startActivityForResult(chooser, REQUEST_PICK_WALLPAPER);    }

这个action是WallpaperChooser.java来响应的。
<activity            android:name="com.android.launcher2.WallpaperChooser"            android:label="@string/pick_wallpaper"            android:icon="@drawable/ic_launcher_wallpaper"            android:screenOrientation="nosensor"            android:finishOnCloseSystemDialogs="true">            <intent-filter>                <action android:name="android.intent.action.SET_WALLPAPER" />                <category android:name="android.intent.category.DEFAULT" />            </intent-filter>        </activity> 

在WallpaperChooser中通过
addWallpapers(resources, packageName, R.array.wallpapers);        addWallpapers(resources, packageName, R.array.extra_wallpapers);

来设置,找到wallpapers.xml就行了。

更多相关文章

  1. Android(安卓)CollapsingToolbarLayout:将ActionBar载入Toolbar(2)
  2. Android(安卓)为Notification加上一个进度条
  3. 第一篇 GridView控件
  4. 利用xml文件创建Menu
  5. android dialog和activity 改变出现消失的 动画样式
  6. 第六篇 Gallery与ImageSwitcher混合使用
  7. Android(安卓)解决 Toolbar 的 Menu 图标无法显示
  8. Android(安卓)DrawerLayout 使用
  9. Android中一种ThreadPool的实现

随机推荐

  1. 技术干货 | mPaaS 框架下如何使用 Crash
  2. 排查指南 | mPaaS 小程序被卡在了三个蓝
  3. 技术干货 | “选图预览并上传”的场景如
  4. 排查指南 | 当 mPaaS 小程序真机扫码时提
  5. 技术干货 | 深度解构 Android 应用面临紧
  6. 技术干货 | mPaaS 小程序高玩带你起飞:客
  7. 绝密文档公开!首次揭秘数栈导航设计思路
  8. 腾讯企业邮箱启用超大附件
  9. 货运物流移动端解决方案:为货运物流行业打
  10. 开发技巧 | mPaaS 小程序自定义事件,如何