什么是ArrayAdapter? [英] What Is ArrayAdapter?

查看:29
本文介绍了什么是ArrayAdapter?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的没有看到 ArrayAdapter 和 ArrayList 之间的区别......它们都保存数组,并对它们进行不同类型的操作......要么是我对 ArrayAdapter 的理解不正确?请帮忙!谢谢.

I am really not seeing the diffrence between ArrayAdapter and ArrayList... They both hold arrays, and do diffrent kinds of operations on them.. Its either that or i am not understanding ArrayAdapter Properly? Please help! Thankyou.

推荐答案

ArrayList 的实现java.util.List 由数组支持.您可以在任何需要使用 java.util.List 的地方使用它.例如.您需要维护允许重复的对象集合的顺序.

ArrayList is an implementation of java.util.List that's backed by an array. You can use it anywhere you would use a java.util.List. E.g. where you need to maintain order of a collection of objects where duplicates are allowed.

ArrayAdapter 是一个用于适配对象数组的 Android SDK 类作为数据源.Android 使用适配器来统一处理结果集,无论它来自数据库、文件还是内存中的对象,以便它可以显示在 UI 元素中.ArrayAdapter 对后者很有用.在任何需要使用适配器的地方使用它.例如.附加到 Android UI 元素.

ArrayAdapter is an Android SDK class for adapting an array of objects as a datasource. Adapters are used by Android to treat a result set uniformly whether it's from a database, file, or in-memory objects so that it can be displayed in a UI element. The ArrayAdapter is useful for the latter. Use it anywhere you would use an Adapter. E.g. attach to Android UI elements.

它们都包裹了一个数组,但并不是所有包裹数组的东西都是一样的.这两个类有非常不同的目标,它们实现不同的接口.

They both wrap an array, but not everything that wraps an array is the same. These two classes have very different goals, and they implement different interfaces.

这篇关于什么是ArrayAdapter?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆