Following this solution I have run into an issue with the code presented. The app forces a close every time I pick a contact from the list that pops up. Something tells me the culprit has something to do with this which I found in logcat.
Here is my version of the code:
public void onActivityResult(int reqCode, int resultCode, Intent data) {
super.onActivityResult(reqCode, resultCode, data);
switch (reqCode) {
case (1) :
if (resultCode == Activity.RESULT_OK) {
Uri contactData = data.getData();
Cursor cursor = managedQuery(contactData, null, null, null, null);
cursor.moveToFirst();
String name = cursor.getString(cursor.getColumnIndexOrThrow(Contacts.People.NAME));
String number = cursor.getString(cursor.getColumnIndexOrThrow(Contacts.People.NUMBER));
name1.setText(name);
num1.setText(number);
}
break;
}
}