diff --git a/api/current.xml b/api/current.xml index 28d417cbef484..e0380e70e0950 100644 --- a/api/current.xml +++ b/api/current.xml @@ -197895,6 +197895,32 @@ + + + + + + + + extends BaseAdapter implements Filterable { */ private boolean mNotifyOnChange = true; - private Context mContext; + private Context mContext; private ArrayList mOriginalValues; private ArrayFilter mFilter; @@ -180,6 +181,44 @@ public class ArrayAdapter extends BaseAdapter implements Filterable { } } + /** + * Adds the specified Collection at the end of the array. + * + * @param collection The Collection to add at the end of the array. + */ + public void addAll(Collection collection) { + if (mOriginalValues != null) { + synchronized (mLock) { + mOriginalValues.addAll(collection); + if (mNotifyOnChange) notifyDataSetChanged(); + } + } else { + mObjects.addAll(collection); + if (mNotifyOnChange) notifyDataSetChanged(); + } + } + + /** + * Adds the specified items at the end of the array. + * + * @param items The items to add at the end of the array. + */ + public void addAll(T ... items) { + if (mOriginalValues != null) { + synchronized (mLock) { + for (T item : items) { + mOriginalValues.add(item); + } + if (mNotifyOnChange) notifyDataSetChanged(); + } + } else { + for (T item : items) { + mObjects.add(item); + } + if (mNotifyOnChange) notifyDataSetChanged(); + } + } + /** * Inserts the specified object at the specified index in the array. * @@ -236,7 +275,7 @@ public class ArrayAdapter extends BaseAdapter implements Filterable { */ public void sort(Comparator comparator) { Collections.sort(mObjects, comparator); - if (mNotifyOnChange) notifyDataSetChanged(); + if (mNotifyOnChange) notifyDataSetChanged(); } /**