0

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? I have already defined the onclicklisteners so I don't need someone trying to explain that to me. I just need to know the proper approach to add the "Add as Contact" dialog.

TheJavaCoder16
  • 591
  • 4
  • 14
  • 1
    I don't know if you're looking to create your own dialog or just have the built-in one pop up, but the 2nd answer here: http://stackoverflow.com/questions/1895206/how-can-i-launch-the-add-contact-activity-in-android will take care of the latter. You just need to send the text from your textview as the second extra in the sample code. – hBrent Jul 14 '14 at 22:13
  • @hBrent Could you make your comment an answer so I can mark it as my answer to help anyone else? – TheJavaCoder16 Jul 15 '14 at 13:46
  • I made my comment an answer. Glad it helped. – hBrent Jul 15 '14 at 21:00

1 Answers1

1

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. You just need to send the text from your textview as the second extra in that sample code.

Community
  • 1
  • 1
hBrent
  • 1,696
  • 1
  • 17
  • 38