I need to toggle existing android contacts to favourite. I have a toggle button which is suppose to s开发者_如何学Goet/unset current contact as favourite.
Any help regarding this is appreciated.
Thanks in advance.
Try setting the People.STARRED value:
// 1 = the new contact is added to favorites
// 0 = the new contact is not added to favorites
values.put(People.STARRED, 1);
Read here for details.
精彩评论