I have a ListView where each item represents a podcast. Selecting an item plays the podcast. While playing, the view for that ListView item displays an elapsed time counter with a SeekBar next to it to show progress.
Where I’m having a problem is figuring out how to handle updating the elapsed time counter (a TextView) while the SeekBar is being repositioned by touch. Calling notifyDataSetChanged during the onProgressChanged SeekBar event doesn’t seem to work very well.
I’m not a huge fan of this UI pattern, simply because if the user scrolls, they may have difficulty finding where they were again. I would recommend having your
SeekBarand counter, plus information about the podcast currently playing, outside of theListView— perhaps in a layout that is set to have visibilityGONEand is animated in when the user chooses a podcast.Lacking that, I think you are in for a fair amount of coding pain.
You are correct that
notifyDataSetChanged()is probably not the answer. Instead, you will probably need to work with theTextViewdirectly…while it is on-screen. Tracking when it is and is not on-screen is the job of yourAdapter, though the details would vary significantly depending on how you are actually implementing the list (e.g., different view types for the rows?).