不确定如何处理ListView IllegalStateException:“适配器的内容已更改,但ListView尚未收到通知”

问题描述 投票:-1回答:2

很抱歉,我需要在UI线程上运行某些代码,我该怎么做?私人ArrayList JsonFIveDays(String weatherSearchResults)是我设置列表视图适配器的地方,如果有帮助的话。

enter image description here

enter image description here

enter image description here

android android-studio listview asynchronous
2个回答
0
投票

只要在weatherArrayList中进行更改,就必须通知适配器。


0
投票

您需要通知适配器您已使用notifyDataSetChanged()更改了数据。更改数据后,可以在setData方法中执行此操作。

© www.soinside.com 2019 - 2024. All rights reserved.