how to get all elements of an ArrayAdapter?

android, listview

Solution

Using `Adapter.getCount()` you can know how many items you have in the adapter, while using `Adapter.getItem(index)` will give you the item.

for(int i=0 ; i<adapter.getCount() ; i++){
   Object obj = adapter.getItem(i);
}

Problem

I need get all elements of ArrayAdapter of an ListView. Like this: ``` this.array = new ArrayAdapter<DocumentoDominiabilidade>(getActivity(), android.R.layout.simple_list_item_1); this.documentosDominiabilidade.setAdapter(array); // after many operations this.array.getAllElements() // return a List of Elements???? ``` thank you

Original source