[英]Android: how to remove an item from a listView and arrayAdapter
[英]How to update an item from ArrayList on ArrayAdapter in Android
我是開發Android的新手,我有一個ListView和自定義的ArrayAdapter,其中包含一個arraylist。我想按位置更新特定於arraylist的項目。我該如何處理,請事先幫助我。
假設您的適配器正在存儲Foo
對象的List
。
Foo item = mAdapter.getItem(position);
item.setValue("blah"); //Or whatever you need to update
mAdapter.notifyDataSetChanged();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.