please help me out to show the progress dialog in listview item.
public class DealerSubCatListAdapter extends BaseAdapter {
private Context context;
private ArrayList<Image> Image;
private LayoutInflater inflater = null;
public DealerSubCatListAdapter(Context context, ArrayList<Image> Image) {
this.context = context;
this.Image = Image;
inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
notifyDataSetChanged();
}
@Override
public int getCount() {
return Image.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = null;
if (convertView == null) {
view = inflater.inflate(R.layout.imagesubcat, null);
} else {
view = convertView;
}
TextView imagesubcat = (TextView) view.findViewById(R.id.imagesubcattv);
// tagLine
imagesubcat.setText(Image.get(position).image_type);
return view;
}
}
So, this is the adapter show the listview item.
Check out the Listview with ProgressBar it might help you.
have a progress bar in R.layout.imagesubcat
and declare an array of integer for progress
int[] progress;
in constructor pass the progress array
now in getview
progressBar.setProgress(progress[position]);
whenever any progress changes just notify adapter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With