[android] How can I update a single row in a ListView?

I used the code that provided Erik, works great, but i have a complex custom adapter for my listview and i was confronted with twice implementation of the code that updates the UI. I've tried to get the new view from my adapters getView method(the arraylist that holds the listview data has allready been updated/changed):

View cell = lvOptim.getChildAt(index - lvOptim.getFirstVisiblePosition());
if(cell!=null){
    cell = adapter.getView(index, cell, lvOptim); //public View getView(final int position, View convertView, ViewGroup parent)
    cell.startAnimation(animationLeftIn());
}

It's working well, but i dont know if this is a good practice. So i don't need to implement the code that updates the list item two times.

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to android-listview

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference CardView not showing Shadow in Android L android - listview get item view by position Custom Listview Adapter with filter Android How to create a custom navigation drawer in android Swipe ListView item From right to left show delete button How can I parse a local JSON file from assets folder into a ListView? Add Items to ListView - Android ListView with Add and Delete Buttons in each Row in android Converting JSONarray to ArrayList

Examples related to android-arrayadapter

ArrayAdapter in android to create simple listview OnItemClickListener using ArrayAdapter for ListView Android custom Row Item for ListView Android ListView headers How does the getView() method work when creating your own custom adapter? "ArrayAdapter requires the resource ID to be a TextView" xml problems android listview item height How can I update a single row in a ListView? notifyDataSetChanged example What is "android.R.layout.simple_list_item_1"?