使用SimpleAdapter我已經一個ListView填充在ListView中的項目:編輯使用簡單的適配器
List<Map<String, String>> listItems = new ArrayList<>();
listItems.add(createItemMap(R.string.rename_mobtag, R.string.rename_mobtag_help));
listItems.add(createItemMap(R.string.change_icon, R.string.change_icon_help));
listItems.add(createItemMap(R.string.become_invisible, R.string.become_invisible_help));
ListView mobtagSettings = (ListView) findViewById(R.id.mobtag_settings);
final String[] fromMapKey = new String[]{TITLE_KEY, HELP_KEY};
final int[] toLayoutId = new int[]{android.R.id.text1, android.R.id.text2};
SimpleAdapter simpleAdapter = new SimpleAdapter(this, listItems, android.R.layout.simple_list_item_2, fromMapKey, toLayoutId);
mobtagSettings.setAdapter(simpleAdapter);
我需要更新爲特定項目的TextViews響應於外部事件(因此我不能使用點擊監聽器)。我怎麼能得到的TextViews,所以我可以改變他們的文本?