Android编程...如何加载联系人照片,以便我可以在应用程序中使用它们?

时间:2010-08-04 20:02:20

标签: android contacts

我想简单地只加载我所有联系人的联系人照片并将其显示在gallery.widget中...我是否创建了一个查询?我只是想做People.loadcontactphoto,但是收到了错误....任何简单的方法都可以做到这一点?

1 个答案:

答案 0 :(得分:0)

您是否考虑过使用SpinnerAdapter?您可以在loadContactPhoto方法中使用getView,并确保getDropDownView调用getView。这应该通过使用联系人的图像加载默认视图来完成工作。

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;
}
相关问题