For updating a single list item you have to get the view at the specified position, and then update the view.
You can get list_item using the following method,
public View getViewByPosition(int position) {
final int firstListItemPosition = filesListview.getFirstVisiblePosition();
final int lastListItemPosition = firstListItemPosition + filesListview.getChildCount() - 1;
if (position < firstListItemPosition || position > lastListItemPosition) {
// return filesListview.getAdapter().getView(position, filesListview.getChildAt(position), filesListview);
return null;
} else {
final int childIndex = position - firstListItemPosition;
return filesListview.getChildAt(childIndex);
}
}
The above the method will return the view if the View at the given position is visible in the listview otherwise it will return null. For example if the list view contains 20 elements and currently listview is showing 0-6 elements then above method will return the views for 0-6 and others will return null.
View viewByPosition = getViewByPosition(position;
// If the retrived view is not null then udpate the view otherwise ignore.
if (viewByPosition != null) {
//Update the view
}