ITEEDU


ListAdapter

翻译时间:2010-11-03

版本:Android 2.2 r1

 

结构

继承关系

public interface ListAdapter extends Adapter

        

android.widget.ListAdapter

 

子类及间接子类

直接子类

         ArrayAdapter<T>, BaseAdapter, CursorAdapter, HeaderViewListAdapter, ResourceCursorAdapter, SimpleAdapter, SimpleCursorAdapter, WrapperListAdapter

 

类概述

扩展Adapter 是在ListView与数据之间的一座桥梁。通常数据来自于游标,但不是必须的。ListView可以显示包含在ListAdapter里的所有数据。

 

公共方法

public abstract boolean areAllItemsEnabled ()

在ListAdapter中所有的项目都是可用的?如果是,则代表所有的项目都是可选择,可用鼠标点击的。

                  返回值

如果所有项目是可用的返回真

 

public abstract boolean isEnabled (int position)

如果指定的位置不是一个隔离(separator)项目(隔离项目是一个不可选择,不可用鼠标点击的项目)则返回真。如果位置是无效的,其结果将是不确定的。在这种情况下一个ArrayIndexOutOfBoundsException(越界)异常将抛出。

参数

                            position    项目的索引

返回值

如果这个项目不是一个隔离(separator)项目则返回真。

 

补充

文章精选

 android adapter的体系