CustomAdapter cusAdapter = new CustomAdapter( ManageYourAccountActivity.this, R.layout.manage_your_account_exist, name); view.setAdapter(cusAdapter);
public class CustomAdapter extends ArrayAdapter<GetAllDatas>{ Context con; GetAllDatas gAD; private int viewResourceId; private int condition; ArrayList<GetAllDatas> names; /* ArrayList<String> h;*/ public CustomAdapter(ManageYourAccountActivity context, int resourceId, ArrayList<GetAllDatas> name) { super(context, resourceId, name); this.con = context; this.names = name; this.viewResourceId = resourceId; // this.condition=condition; /*gAD = new ArrayList<GetAllDatas>(); gAD.addAll(name);*/ } private class ViewHolder { //ImageView bitmapimage; TextView headlineView; TextView reporterNameView; //TextView txtSize; } @Override public View getView(int position, View convertView, ViewGroup parent){ //ViewHolder holder = null; // Bitmap loadBitmap=null; ViewHolder holder; // System.gc(); LayoutInflater mInflater = (LayoutInflater) con .getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (convertView == null) { convertView = mInflater.inflate(viewResourceId, null); holder = new ViewHolder(); holder.headlineView = (TextView) convertView.findViewById(R.id.txtprice1); holder.reporterNameView = (TextView) convertView.findViewById(R.id.txtdesc1); // holder.reportedDateView = (TextView) convertView.findViewById(R.id.date); //convertView.setTag(holder); gAD = names.get(position); if(gAD != null){ holder.headlineView.setText(gAD.getPrice()); holder.reporterNameView.setText(gAD.getDescription()); } } // } else { // holder = (ViewHolder) convertView.getTag(); // } /* holder.headlineView.setText(names.get(position).getPrice()); holder.reporterNameView.setText("By, "+position+names.get(position).getDescription()); //holder.reportedDateView.setText(listData.get(position).getDate()); */ return convertView; } public int getCount() { return names.size(); } @Override public GetAllDatas getItem(int position) { return names.get(position); } @Override public long getItemId(int position) { return position; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)