Latest in the work on Android 4.1 to do some customization, just encountered the setting of third party live wallpaper as the default boot wallpaper problem, then make notes as follows.
The files that need to be modified are:
Found in Sourcecode/framework/base/core/res/res/values/config.xml:
- <string name="default_wallpaper_component"> @null</string>
Modify the @null to include the following:
- <string name="default_wallpaper_component" translatable="false"> Package name/Live Wallpaper service name < /string>
For example, to change the default wallpaper to "grass shaking" live wallpaper, you need to change to the following code:
- <string name="default_wallpaper_component" translatable="false"> Com.android.wallpaper/com.android.wallpaper.grass.grasswallpaper</string>
Com.android.wallpaper in the Androidmanifest file Packagename,com.android.wallpaper.grass.grasswallpaper The service name in the Androidmanifest file needs to be noted: static picture wallpaper and live wallpaper are two different systems, loaded when is completely two sets of mechanisms, static pictures through the launcher inside an XML file configuration to manage the system default static wallpaper, Live wallpaper is through the intent mechanism to search all matching Activity to the system, so, the default value here is NULL, instead of the system default static wallpaper address, the system is read the configuration. config file. Null to continue looking for static wallpaper configuration content. After setting no effect, restore the factory settings. In addition, we will need to use the third-party live wallpaper, pre-preset to Sytem/app in advance;
Ps:
1. Here must remember, the package name with Androidmanifest.xml, the service name in the back must also be consistent with the androidmanifest.xml, otherwise, will be reported classnotfoundexception;
2. Another preset live wallpaper apk name does not contain spaces, otherwise it will be reported classnotfoundexception, the space can be replaced by the underscore;
Android 4.1 Set default boot Live wallpaper