开发者

How to set contact as favourite through coding?

开发者 https://www.devze.com 2023-01-29 10:25 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消