解决方案 »
- android程序 加载.so库无法找到标准c++库Libray 'libstdc++.so.6' not found
- 编程如何打开smb共享文件?
- SlidingDrawer的使用
- 编译ffmpeg时如何进行neon优化?
- 一个令人无比蛋疼的线程里更新ListView的问题
- 帮忙看下这错误如何解决
- 请教一个输入框的问题
- android 模拟器上点击导航键产生相应功能应该怎么实现呢?
- connection.getInputStream()抛出java.io.FileNotFoundException
- android Bluetooth LE , BluetoothAdapter.startLeScan (),无法开始搜索,返回false
- 求助Android Canvas实现点击输入文字
- 新人,有问题求助
switch (msg.what) { case HadwareControll.BARCODE_READ: {
String result = msg.obj + "\n";
buildAdapter(result);
break;
}
default:
break;
}
}
}
private void buildAdapter(String barcode) { String wh = barcode.substring(0, 5);
String po = barcode.substring(6, barcode.length() - 1); List<HashMap<String, String>> list = new ArrayList<>(); HashMap<String, String> map = new HashMap<>();
map.put(Constants.LIST_WH, wh);
map.put(Constants.LIST_PO, po);
list.add(map); spAdapter.notifyDataSetChanged(); return ;
} 我也是稍微了解了点安卓listview ,这是我根据你的修改的,你看看行不?你那样的话肯定是不行的
list.add(map);
这个list 用你第一次设置时的list 不要new一个新的
spAdapter.notifyDataSetChanged();
这个 spAdapter 也是第一次设置的时候那个
你试试吧, 修改好了应该可以