Posts

Showing posts with the label android-arrayadapter

Android listview using ViewHolder

Image
Clash Royale CLAN TAG #URR8PPP Android listview using ViewHolder I have a problem. I'm attempting to change an icon in my listview after it has been clicked. It works correctly although are not modified only the clicked icons but also those who are not displayed. For example if I click the icon in the first item of the listview, also the fifth icon changes. This behaviour is repeated for all the following items (every five items of the listview). This is my getView method: public class AlphabeticalAdapter extends ArrayAdapter<String> { int layoutResourceId; private final Context context; private List<String> data; private ProgressDialog mProgressDialog; private ImageView downloadImageButton; public AlphabeticalAdapter(Context context, int resource, List<String> data){ super(context, resource, data); this.layoutResourceId = resource; this.context = context; this.data = data...