Skip to content Skip to sidebar Skip to footer

Change Single Item Listview Android With Asynctask

I'm learning how to change single item custom listview android with AsyncTask, I've followed this tutorial. but it's seem not work in my listview. this my code private class ViewH

Solution 1:

The logic issue with your code is the following: You shouldn't update ViewHolder outside of getView(). ViewHolder is just about making list performance better and shouldn't be used as reference to list items in any moment of time.

In your case, to fix the issue You should call holder.jmlh_favorite.setText(status_favorite) inside getView() (e.g. store position and text somewhere). From displaylaporanList() You just need to call notifyDataSetChanged() to notify the Adapter that the data has been changed and list items should be updated. Also, refer to this session from Google I/O for more details about ListViews.

Post a Comment for "Change Single Item Listview Android With Asynctask"