Updating the relative time in android

牧云@^-^@ 提交于 2019-12-11 05:34:39

问题


I am developing a Twitter client application. As with other twitter clients, I would like to display the relative time of tweet with respect to the current time. I am using a list view and a Simple adapter that binds to an arraylist which stores the tweet information. If I calculate the relative time and store a string, I will be just storing static data which will never get updated. How should I update this data?? Is there any way to do this?


回答1:


You will have to incorporate on your adapter a recalculation every X seconds. And if you update your adapter, the listview will update itself too.



来源:https://stackoverflow.com/questions/3209000/updating-the-relative-time-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!