I would like to add a favorites star like the one in the contacts list on android. Is there any way we can get that star or will I have to write my own? I can\'t seem to find
The source code to the Contacts application is available online, since Android is open source.
Some poking around in there will lead you to the contact_header.xml
file, found in your SDK installation. It indicates that the star is implemented via a CheckBox
:
That, in turn, routes you to an entry in a theme:
- @android:style/Widget.CompoundButton.Star
which in turn resolves to:
So, use those images with a CheckBox
, and you should get the same behavior. Those images are also available in your SDK installation.