Question

I am looking to alter the android source code Home sample, just to have a play around and increase my knowledge.

I have placed the sample on a Samsung S2 and when I press the home button the option comes up to select between the home sample and TouchWiz.

I am looking to alter the code to have an icon available on the stock home screen so that when it is selected the option is given to select between the home sample and TouchWiz. I can't seem to find in the source code where I need to alter this.

If anyone could point me in the right direction it would be much appreciated.

Thanks

Was it helpful?

Solution

I am looking to alter the code to have an icon available on the stock home screen so that when it is selected the option is given to select between the home sample and TouchWiz.

I am assuming that by "stock home screen" you mean "sample home screen". In that case, the "stock home screen" is an Activity. You would add an "icon" to the "stock home screen" the same way that you would in any other Android activity, such as by modifying the res/layout/home.xml layout file to contain an ImageButton.

OTHER TIPS

I believe if you want to add an 'icon' to the home screen (assume you're referring to Launcher2 in AOSP source), you can just add an <favorite> tag in [Launcher2/res/xml/default-workspace.xml][1] and recompile using mmm.

However, this approach requires the 'icon' pointing to a package (or an Application) that is actually installed on the device. I am not sure if favorite can launch an intent directly, as the action to pick home screen is usually initiated when user sends HOME intent; another issue with using intent directly is once the user sets certain application as default handler, launching the intent no longer brings up the application selector and thus will nullify your desire to switch launcher.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top