views:

146

answers:

1

I am trying to simply load just the contact photo of all my contacts and display them in a gallery.widget...Do I create a query? I was trying simply just to do People.loadcontactphoto but was getting errors....Any easy way to do this?

A: 

Have you considered using a SpinnerAdapter? You could use loadContactPhoto in the getView method and make sure getDropDownView calls getView. This should get the job done by loading the default view with the image from the contact.

public View getDropDownView(int position, View convertView, ViewGroup parent) {
    return getView(position, convertView, parent);
}

public View getView(int position, View row, ViewGroup parent) {
    //loadContactPhoto
    //set the view image to be the contact photo
    //...

    //This is an over simplification of the method
    //a custom layout may need to be inflated.

    return row;
}
Quintin Robinson