Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6252889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:53:17+00:00 2026-05-24T13:53:17+00:00

I am building my own contact picker, because I needed multi-select support. Everything is

  • 0

I am building my own contact picker, because I needed multi-select support. Everything is working fine, except for one small problem with the contact images.

For contacts who don’t have images I am showing a “no image” image. This works fine for contacts in the phone’s address book. I am having a problem however when it comes to images from my google contacts.

Most of my google contacts do not have photos. However, when i query the Contacts database for photos, it still returns a URI for them of the form of content://com.android.contacts/contacts/657/photo (which is the same format as for contacts who do have a photo.

Then when I try to assign the photo to a QuickContactBadge, using bdg.setImageURI(pic); it sets it to essentially a blank picture, and logs a silent INFO message stating:

INFO/System.out(3968): resolveUri failed on bad bitmap uri: 
content://com.android.contacts/contacts/657/photo

I need to know how I can either
a) validate the URI or
b) catch the INFO message above
c) query the imageview/badge to see if it found a valid image

so that i can assign these contacts my “no image” image.
How can I go about doing this?

EDIT 20110812.0044

I have tried adding this to my code as per Laurence’s suggestion (which he’s since removed):

// rv is my URI variable
if(rv != null) {
    Drawable d = Drawable.createFromPath(rv.toString());
    if (d == null) rv = null;
}

While the google contacts now get my “no image” image, … so do all the other contacts, including ones that do in fact have images.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:53:18+00:00Added an answer on May 24, 2026 at 1:53 pm

    Okay, I figured out how to do this after poking through the ImageView source code. It is actually using the QuickContactBadge’s own methods, but if necessary, one could always extract the relevant code from the Badge/ImageView control here.

    After setting the QCB’s image, I check to see if its drawable is null, instead of trying my own (as per Laurence’s suggestion). This works better, because there is actually a whole slew of checking code the ImageView widget uses.

    Here is my final code:

    bdg.setImageURI(pic);
    if(bdg.getDrawable() == null) bdg.setImageResource(R.drawable.contactg);
    

    This works perfectly as I was hoping and expecting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a small device with its own CPU (AVR Mega8) that is
I'm building my own website in PHP, somehow my tracking has stopped working since
I'm building my own JSP Tag Library which need to support some features that
I'm building my own C2DM application right now. I first started with a small
I have for some time now being building my own calendar because the standard
I am currently building my own small scale Blog CMS with ASP MVC C#.
I'm working on building my own base user interface classes. On them, I want
I am building my own CRM access database that will contain a list of
I am building my own local search UI element that gives local search suggestions
I am learning a lot about design patterns when I am building my own

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.