search

Home  >  Q&A  >  body text

android - 已读未读消息如何实现?

1.如何在一个从网络加载数据的listView中实现点击item后的已读未读消息?(当界面刷新或者后台有新数据时依然是未读状态)
2.如何在本地加载的listView实现已读未读状态? (也是刷新或者添加新数据后)

怪我咯怪我咯2772 days ago640

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 17:12:17

    1. The data obtained on the network has been read and unread. After clicking, it should trigger a request to update the data and then update the data to read.
    2. For local data and network, the message is read from the database. The default is unread. Click (or a self-defined trigger form) to update the data as read.

    All of the above only ensures the synchronization of data. Secondly, you also need to update the list status through notifydatasetchanged of the listview adapter to ensure that the interface is displayed correctly.

    reply
    0
  • Cancelreply