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

查看:158
本文介绍了什么是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天全站免登陆