Android: Simple way to call phone book and return number -


I'm really new to Android programming, so I have a simple question to get phone numbers from contacts in my application . The method I want to apply is that the user clicks a button in my app and contacts will be sent. In the contacts, the user must click on a phone number and return this number to a text field.

Thank you for your reply.

Start intending to connect with activative force-result. In your case you simply add startActivityForResult call to the OnClick listener for the button.

  Extension of the public class MyActivity activity (static end-end PICK_CONTACT_REQUEST = 0; Boolean protected by KeyDown (Int kikod, Key Event event) {if (keycode == KeyEvent.KEYCODE_DPAD_CENTER) {// When user If the center presses, then select them a contact StartActivityForResult (the new intent (Intent.ACTION_PICK, new URI ("Content: // contact")), PICK_CONTACT_REQUEST; return true;} the details are false;} Active Result on Active Zero Requestcode, INC results, results, data) // will display it to the intersection. Click on initial (new intent (intent.ACTION_VIEW, data))}}}}  

Comments