l'm new here so hope to follow guidelines as I'm a newbie for both the side and android.
For my first app I'm trying to make a world clock. In order to check it the time is shown and update in seconds. (00:00:00) As the only thing I want to update every second is the time I don't want to use: ListView's notfiyDataHasChanged()
I have a custom ListView & extended BaseAdapter and row.xml with each ListView item layout.
Trying: lv.getChildCount() returns 0; So I understand it has no child. But I don't know how I开发者_如何学编程 can retrieve the View of the specific item in the listview. Then call that view's TextView by findViewById(R.id.time) and set it each second.
I've googled and read alot of threads but still didn't get that :(
Thank You.
I would go a different way about that problem: Subclass the TextView widget into your own TimeView widget and include that one in your row layout.
The TimeView widget will own a handle that calls itself to refresh the view.
Hence, automatically, all views visible in the list will update themselves, the other adapter items will not be having views and won't as a consequence require any update.
精彩评论