Code show an error when try declare a new Uri
follow code:
Intent pickContactIntent = new Intent(Intent.ACTION_PICK, new Uri("content://contacts"));
show an error
“Cannot instantiate the type Uri”
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Instead of constructing a
Uri, use the staticparsemethod to create it:Although, since you are accessing contacts, you should probably prefer using the static field
CONTENT_URIfrom theContactsclass. See the SDK reference for Contacts.This would make your code: