开发者

How to set contact as favourite through coding?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜