简体   繁体   English

显示对话框以从单击的电话号码添加新联系人

[英]Show Dialog to add new contact from clicked phone number

My app has a page with textviews for displaying company phone numbers, and I was wondering how I can tell the android to pop up a dialog that wants to add the number as a contact when a user clicks it? 我的应用程序有一个带有用于显示公司电话号码的文本视图的页面,我想知道如何让android弹出一个对话框,当用户单击该对话框时将其添加为联系人? I have already defined the onclicklisteners so I don't need someone trying to explain that to me. 我已经定义了onclicklistener,因此不需要有人试图向我解释这一点。 I just need to know the proper approach to add the "Add as Contact" dialog. 我只需要知道添加“添加为联系人”对话框的正确方法即可。

The code in the 2nd answer here: How can I launch the 'Add Contact' activity in android will cause the built-in Android contacts dialog to open. 此处第二个答案中的代码: 如何在android中启动“添加联系人”活动将导致内置的Android联系人对话框打开。 You just need to send the text from your textview as the second extra in that sample code. 您只需要从textview发送文本,作为该示例代码中的第二个附加内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM