Question

How would I add a Google Plus One button to my Android live wallpapers settings like the following?

Plus One button in settings

Was it helpful?

Solution

Well here is how I would do it, I haven't tested it just searched over Google.

  • You will have to use the Google Plus API, here you can see how to add +1 button to a layout in the accepted answer.

  • Now you know how to add +1 button, to add this to your preference screen you have to create a Preference item with a custom layout which is explained here. In this custom layout you put the previously created layout with the +1 button and then you add it to your Preference List.

  • Now you have a Preference item with a custom layout with a +1 button, just add an onClickListener to the Preference item with the +1 button and using Google Plus API do whatever you want when user clicks it!

Another way is to add Google Plus icon to the preference:

  • Create a Preference item and add Google Plus icon to it as described here.

  • Add an onClickListener to the Preference item and using Google Plus API do whatever you want when user clicks it.

Hope this can help you! Sorry for my bad English!

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