Android的更新联系人姓名 [英] android update contact name

查看:151
本文介绍了Android的更新联系人姓名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要更新的联系人姓名,但我没有办法做到这一点与旧的联系人API(我的应用程序必须1.5,1.6和2.x工作)的方式

I need to update a contact name but i didn't way the way to do that with the old contact api (my application must work in 1.5,1.6 AND 2.X)

推荐答案

阿含好做这样的事情。

意图I =新意图(Intent.ACTION_EDIT);

Intent i = new Intent(Intent.ACTION_EDIT);

i.setData(Uri.parse(内容://com.android.contacts/raw_contacts/1));

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

//这里1是接​​触ID进行编辑。您还可以自动生成了。

//Here 1 is the id of the contact to edit. You can also generate it automatically.

startActivity(ⅰ);

startActivity(i);

如果你的意思是在运行时,你想从一个文本框中选择ID,你可以这样做

If you mean at runtime you want to select id from an text box , you can do something like

意图I =新意图(Intent.ACTION_EDIT);

Intent i = new Intent(Intent.ACTION_EDIT);

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

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

//这里的textBox应该有任何接触数值进行编辑。

//Here textBox should have any numerical value of the contact to edit.

startActivity(ⅰ);

startActivity(i);

这篇关于Android的更新联系人姓名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆