Need to pick contact from a dialog preference
- by MLW
I would like to add a preference setting that uses an ACTION_PICK intent. My goal is to acquire the phone number of a contact in my phone by using a preference. Is this possible?
I can run this code from my activity but I discovered I cannot run it from a class that extends DialogPreference.
Intent intentContact = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intentContact, PICK_CONTACT);
Or is there a way to start a new activity from a preference? Then that activity could execute the above two lines of code?