我的老闆說我要使用Android查詢負載ListView中的圖像異步的,我發現這個網站:http://code.google.com/p/android-query/wiki/ImageLoading 但是我試着用:(安卓)從URL
aq.id(R.id.image1).image("http://www.vikispot.com/z/images/vikispot/android-w.png");
在我的代碼,但我得到這個錯誤: 「aq不能解決」 我必須做什麼來初始化aq,我必須導入一些庫?
這是我的列表視圖適配器: public static class ListViewAdapterWall extends BaseAdapter {0}私有LayoutInflater mInflater;
public ListViewAdapterWall(Context context) {
mInflater = LayoutInflater.from(context);
}
public int getCount() {
return ListviewContentWall.size();
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
ListContent holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.listviewinflate, null);
holder = new ListContent();
holder.wallImage = (ImageView) convertView
.findViewById(R.id.wallImage1);
holder.wallButton = (ImageButton) convertView
.findViewById(R.id.wallButton1);
convertView.setTag(holder);
} else {
holder = (ListContent) convertView.getTag();
}
AQuery aq = new AQuery(convertView);
aq.id(R.id.wallImage1).image("http://www.vikispot.com/z/images/vikispot/android-w.png");
//holder.wallImage.setBackgroundDrawable(ListviewContentWall.get(position));
//holder.wallButton.setBackgroundDrawable(ListviewContentWall.get(position));
//holder.text2.setText(ListviewContent2.get(position));
return convertView;
}
嘗試用'AQuery含水=新AQuery(上下文);' – 2012-07-20 06:26:30