List of usage examples for android.widget WrapperListAdapter getWrappedAdapter
public ListAdapter getWrappedAdapter();
From source file:com.spatialnetworks.fulcrum.widget.DynamicListView.java
private void swapElements(int indexOne, int indexTwo) { ListAdapter listAdapter = getAdapter(); if (listAdapter instanceof WrapperListAdapter) { WrapperListAdapter wrapperListAdapter = (WrapperListAdapter) listAdapter; listAdapter = wrapperListAdapter.getWrappedAdapter(); }//from w ww .j a v a 2 s.co m if (!(listAdapter instanceof ArrayAdapter)) { throw new RuntimeException("DynamicListView can only swap elements using an ArrayAdapter"); } else { ArrayAdapter arrayAdapter = (ArrayAdapter) listAdapter; Object obj2 = arrayAdapter.getItem(indexTwo); //noinspection unchecked arrayAdapter.remove(obj2); //noinspection unchecked arrayAdapter.insert(obj2, indexOne); } }