我正在使用ArrayList<HashMap<String, Object>>
来存储项目。我知道如何将项目添加到此列表中,但我不知道如何删除一个。我尝试了很多东西,比如list.remove(position);
但没有任何效果。我在谷歌上搜索并阅读了大量类似的问题,这些问题对我根本没有帮助。 我的问题是:如何从列表中删除项目?
我的清单:
[
{ title=MyFirstElement, comments=First element of my list },
{ title=ASecondOne, comments=Two elements },
{ title=Third, comments=Never two without three }
]
您能否发布完整的堆栈跟踪。你提到的错误与你的想法无关。它与Json有关。
通常
list.remove(index(
应该适用于您的情况。