diff --git a/core/java/android/widget/ArrayAdapter.java b/core/java/android/widget/ArrayAdapter.java index 869ef71c0d514..74f22b35e0019 100644 --- a/core/java/android/widget/ArrayAdapter.java +++ b/core/java/android/widget/ArrayAdapter.java @@ -37,19 +37,38 @@ import java.util.Comparator; import java.util.List; /** - * A concrete BaseAdapter that is backed by an array of arbitrary - * objects. By default this class expects that the provided resource id references - * a single TextView. If you want to use a more complex layout, use the constructors that - * also takes a field id. That field id should reference a TextView in the larger layout - * resource. - * - *
However the TextView is referenced, it will be filled with the toString() of each object in - * the array. You can add lists or arrays of custom objects. Override the toString() method - * of your objects to determine what text will be displayed for the item in the list. - * - *
To use something other than TextViews for the array display, for instance, ImageViews, - * or to have some of data besides toString() results fill the views, - * override {@link #getView(int, View, ViewGroup)} to return the type of view you want. + * You can use this adapter to provide views for an {@link AdapterView}, + * Returns a view for each object in a collection of data objects you + * provide, and can be used with list-based user interface widgets such as + * {@link ListView} or {@link Spinner}. + *
+ * By default, the array adapter creates a view by calling {@link Object#toString()} on each + * data object in the collection you provide, and places the result in a TextView. + * You may also customize what type of view is used for the data object in the collection. + * To customize what type of view is used for the data object, + * override {@link #getView(int, View, ViewGroup)} + * and inflate a view resource. + * For a code example, see + * the + * CustomChoiceList sample. + *
+ *+ * For an example of using an array adapter with a ListView, see the + * + * Adapter Views guide. + *
+ *+ * For an example of using an array adapter with a Spinner, see the + * Spinners guide. + *
+ *Note: + * If you are considering using array adapter with a ListView, consider using + * {@link android.support.v7.widget.RecyclerView} instead. + * RecyclerView offers similar features with better performance and more flexibility than + * ListView provides. + * See the + * + * Recycler View guide.
*/ public class ArrayAdapter