How do I preset application icons, shortcut icons, or widgets on the desktop?
Modify the res/xml/default_workspace.xml file and add the following code:
Launcher: packageName = "" // complete package name
Launcher: className = "" // complete package name. Class Name (class for processing main intent)
Launcher: screen = "" // screen where the app icon is located (starting from 0)
Launcher: x = "" // column where the app icon is located
Launcher: y = ""/> // row where the app icon is located
Launcher: uri = "http://www.baidu.com"
Launcher: icon = "@ drawable/ic_launcher_baidu"
Launcher: title = "@ string/baidu_title"
Launcher: screen = ""
Launcher: x = ""
Launcher: y = ""/>
Launcher: uri = "# Intent; action = android. intent. action. MAIN; launchFlags = 0x10200000; component = com. cleanmaster. mguard/com. cleanmaster. processcleaner. processCleanerActivity; end"
Launcher: icon = "@ drawable/ic_launcher_application"
Launcher: title = "@ string/jinshan_title"
Launcher: screen = ""
Launcher: x = ""
Launcher: y = ""/>
Launcher: packageName = "com. android. settings"
Launcher: className = "com. android. settings. widget. SettingsAppWidgetProvider"
Launcher: screen = "3"
Launcher: x = "0"
Launcher: y = "0"
Launcher: spanX = "4" // Number of grids in the x direction on the screen
Launcher: spanY = "1" // Number of grids in the y direction on the screen/>
Note:
1. configuration AppWidget cannot be preset.
2. The app widget cannot be preset in The KK version Launcher3 (default Google design)
3. If it is a carrier project, there will be a resource_overlay mechanism. Taking OP01/SPEC0200/SEGC as an example, the preset desktop content is subject to the default_workspace.xml in the following path:
ICS/ICS2: alps/mediatek/source/operator/OP01/SPEC0200/SEGC/OverLayResource/packages/apps/Launcher2/res/xml/default_workspace.xml
JB/JB2: alps/mediatek/operator/OP01/SPEC0200/SEGC/OverLayResource/packages/apps/Launcher2/res/xml/default_workspace.xml
Other carrier projects are similar.