联系方式自定义字段自定义、字段、联系方式

2023-09-04 23:45:17 作者:你也在笑

好吧,我有点新的Andr​​oid SDK中,所以原谅我,如果我的问题没有意义或者是非常微不足道的。我想添加自定义字段联系人,包含在一个网站上我做这个应用程序的联系人的用户名。而且,这个自定义字段,我想有点击它的能力(如发送信息或呼叫移动),这样我可以去我的应用程序中的specif活动,用一个TextView设置的用户名我只是点击。

Alright, I'm a little new to the Android SDK, so forgive me if my question doesn't make sense or is very trivial. I'd like to add a custom field for contacts, that contains the contacts username on a website I'm doing this app for. And, with this custom field, I'd like to have the ability to click it (like "Send message" or "Call mobile") so that I can go to a specif Activity in my application, with a TextView set with the username that I just clicked on.

很抱歉,如果这是一个有点混乱,如果你需要什么东西让我知道!

Sorry if that is a bit confusing, if you need anything else let me know!

推荐答案

它的工作!但我改变Data.CONTACT_ID到Data.RAW_CONTACT_ID这里:

It's working! But I changed Data.CONTACT_ID to Data.RAW_CONTACT_ID here:

if (mod == 0) {
    values.put(Data.CONTACT_ID, this.getId());
    values.put(Data.MIMETYPE, clsContacts.FORMALITY_MIMETYPE);
    ctx.getContentResolver().insert(Data.CONTENT_URI, values);
}