Get original ArrayList from ArrayAdapter
android
Solution
You can do this to get the underlying `ArrayList`
ArrayList<String> underlying = = new ArrayList<String>();
for (int i = 0; i < adapter .getCount(); i++)
underlying .add(adapter .getItem(i));
Problem
How can I retrieve the underlying ArrayList from an ArrayAdapter in Android? Is this possible or do I need to keep track of them seperately? ``` ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new ArrayList<String>()); ArrayList<String> underlying = ```