GridView
このコードを使用したときにコードを更新する方法cla.notifyDataSetChanged
; notifyDataSetChanged
アダプタークラスにメソッドを追加する方法を解決できないと言いますか? 私を助けてくださいあなたは何をしますか?私のアダプタークラスにはnotifyDataSetChange
メソッドがありません
public class fifthscreen extends Activity {
private AQuery androidAQuery;
CategoryListAdapter3 cla;
androidAQuery = new AQuery(this);
static ArrayList<String> Category_name = new ArrayList<String>();
static ArrayList<String> Category_image = new ArrayList<String>();
cla = new CategoryListAdapter3(fifthscreen.this);
gidView.setAdapter(cla);
アダプタ クラス
public class CategoryListAdapter3 extends BaseAdapter {
private Activity activity;
private AQuery androidAQuery;
public CategoryListAdapter3(Activity act) {
this.activity = act;
// imageLoader = new ImageLoader(act);
}
public int getCount() {
// TODO Auto-generated method stub
return fifthscreen.Category_ID.size();
}
public Object getItem(int position) {
// TODO Auto-generated method stub
return position;
}
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ViewHolder holder;
androidAQuery = new AQuery(getcontext());
if(convertView == null){
LayoutInflater inflater = (LayoutInflater) activity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.viewitem2, null);
holder = new ViewHolder();
convertView.setTag(holder);
}else{
holder = (ViewHolder) convertView.getTag();
}
holder.txtText = (TextView) convertView.findViewById(R.id.title2);
holder.imgThumb = (ImageView) convertView.findViewById(R.id.image2);
holder.txtText.setText(fifthscreen.Category_name.get(position));
androidAQuery.id(holder.imgThumb).image(fifthscreen.Category_image.get(position), true,true);
return convertView;
}
private Activity getcontext() {
// TODO Auto-generated method stub
return null;
}
static class ViewHolder {
TextView txtText;
ImageView imgThumb;
}
}