I want to open the native Contact activity, not the Contacts list as I already have done that, but a particular contact information using the native activity. The special requirement here is that all I want is to display the contact's information but not allowing the user to click anything. I can open the activity with this code:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode != 1) {
return;
}
if(resultCode != Activity.RESULT_OK) {
return;
}
Uri selectedUserUri = data.getData();
this.onContactSelected(selectedUserUri);
}
private void onContactsButtonClick() {
startActivityForResult(new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI), 1);
}
private void onContactSelected(Uri selectedUserUri) {
startActivityForResult(new Intent(Intent.ACTION_VIEW, selectedUserUri), 2);
}
I need the user not to be able to click anything because that's not part of the functionalities of my application, in the worst case I would need the activity to report me the clicked phone number or e-mail address instead of opening the dialer or a web browser.
Any help will be greatly appreciated.
Mike