【问题标题】:Update content in the Recycler View without reloading activity在不重新加载活动的情况下更新回收站视图中的内容
【发布时间】:2020-12-10 06:35:46
【问题描述】:

我需要在连接到 Internet 时更新我的​​列表并从 API 上的资源中提取新信息,但我不知道该怎么做。也许有人遇到过这个问题,或者有解决这个问题的办法

【问题讨论】:

    标签: android kotlin retrofit retrofit2 rx-java2


    【解决方案1】:

    您应该检测到互联网连接 Broadcast receiver for checking internet connection in android app

    然后在 onReceive() 回调中,从 API 请求您的数据并更新您的 recyclerview

    【讨论】:

    • 谢谢,我试试
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多