Android Listview notifyDataSetChanged() 不起作用

bash 复制代码
private ArrayList<Map<String, String>> data = new ArrayList<Map<String, String>>();  
private ArrayList<Map<String, String>> delivered_data= new ArrayList<Map<String, String>>();  

如果直接将arraylist 的数据直接复制,无法完成更新

复制代码
data = delivered_data;
adapter.notifyDataSetChanged();

单个元素改变时候,可以更新

bash 复制代码
data.get(position).put("status", Select[0]);  //change the status 
adapter.notifyDataSetChanged();

如果要以数据list直接传递,需要用下面方法

bash 复制代码
 data.clear();
 data.addAll(delivered_data);
 adapter.notifyDataSetChanged();

更改listview用到下面项目中:

相关推荐
小书房16 分钟前
Kotlin的by
android·开发语言·kotlin·委托·by
jinanwuhuaguo1 小时前
(第二十八篇)OpenClaw成本与感知的奇点——从“Token封建制”到“全民养虾”的本体论地基
android·人工智能·kotlin·拓扑学·openclaw
xxjj998a1 小时前
Laravel4.x核心特性全解析
android·mysql·laravel
JoshRen2 小时前
2026教程:在Android Termux中集成Gemini 3镜像站实现移动端文档自动处理与摘要生成(附国内免费方案)
android
诸神黄昏EX3 小时前
Android Google KEY
android
一起搞IT吧3 小时前
Android性能系列专题理论之十一:block IO问题分析思路
android·嵌入式硬件·智能手机·性能优化
小妖6664 小时前
怎么用 tauri 创建编译 android 应用程序
android·tauri
鸟儿不吃草5 小时前
安卓实现左右布局聊天界面
android·开发语言·python
xxjj998a6 小时前
Laravel 1.x:PHP框架的原始魅力
android·php·laravel
formula100006 小时前
在iOS/安卓上远程连接任何 Agent!Claude、Codex、Copilot、Gemini、OpenCode 等
android·copilot