更新android中的相对时间
我正在开发 Twitter 客户端应用程序。与其他 Twitter 客户端一样,我想显示推文相对于当前时间的相对时间。我正在使用列表视图和简单适配器,该适配器绑定到存储推文信息的数组列表。如果我计算相对时间并存储一个字符串,我将只存储永远不会更新的静态数据。我应该如何更新这些数据?有什么办法可以做到这一点吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须在适配器上每隔 X 秒重新计算一次。如果您更新适配器,列表视图也会自行更新。
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.