【问题标题】:android update contact nameandroid更新联系人姓名
【发布时间】:2010-12-17 01:41:27
【问题描述】:

我需要更新联系人姓名,但我没有用旧的联系人 api 执行此操作(我的应用程序必须在 1.5、1.6 和 2.X 中运行)

【问题讨论】:

    标签: android contacts


    【解决方案1】:

    阿汉干得不错

    意图 i = new Intent(Intent.ACTION_EDIT);

    i.setData(Uri.parse("content://com.android.contacts/raw_contacts/1));

    //这里1是要编辑的联系人的id。也可以自动生成。

    startActivity(i);


    如果你的意思是在运行时你想从一个文本框中选择 id ,你可以做类似的事情

    意图 i = new Intent(Intent.ACTION_EDIT);

    i.setData(Uri.parse("content://com.android.contacts/raw_contacts/" + textBox.getText()));

    //这里的textBox应该有要编辑的联系人的任意数值。

    startActivity(i);

    【讨论】:

    • 你能解释一下吗,因为我发布的答案会以编程方式完成
    • 我不想显示新活动。
    猜你喜欢
    • 2015-11-14
    • 2012-10-11
    • 2018-02-15
    • 2020-08-09
    • 2016-05-07
    • 2017-06-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多