
roboguice.adapter.IterableAdapter Maven / Gradle / Ivy
package roboguice.adapter;
import android.content.Context;
import android.widget.ArrayAdapter;
import java.util.ArrayList;
import java.util.List;
public class IterableAdapter extends ArrayAdapter {
public IterableAdapter(Context context, int resource, int textViewResourceId) {
super(context, resource, textViewResourceId);
}
public IterableAdapter(Context context, int resource, int textViewResourceId, Iterable objects) {
super(context, resource, textViewResourceId, toList(objects));
}
public IterableAdapter(Context context, int textViewResourceId) {
super(context, textViewResourceId);
}
public IterableAdapter(Context context, int textViewResourceId, Iterable objects) {
super(context, textViewResourceId, toList(objects));
}
protected static List toList( Iterable objects ) {
final ArrayList list = new ArrayList();
for( T t : objects ) list.add(t);
return list;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy