java.lang.Object

   ↳

android.widget.BaseAdapter

 

   ↳

android.widget.SimpleAdapter

 

Class Overview

An easy adapter to map static data to views defined in an XML file. You can specify the data backing the list as an ArrayList of Maps. Each entry in the ArrayList corresponds to one row in the list. The Maps contain the data for each row. You also specify an XML file that defines the views used to display the row, and a mapping from keys in the Map to specific views. Binding data to views occurs in two phases. First, if aSimpleAdapter.ViewBinder is available,setViewValue(android.view.View, Object, String) is invoked. If the returned value is true, binding has occurred. If the returned value is false, the following views are then tried in order:

  • A view that implements Checkable (e.g. CheckBox). The expected bind value is a boolean.
  • TextView. The expected bind value is a string and setViewText(TextView, String) is invoked. (同时调用SetViewText(TextView, String)方法)
  • ImageView. The expected bind value is a resource id or a string and setViewImage(ImageView, int) or setViewImage(ImageView, String) is invoked.

If no appropriate binding can be found, an IllegalStateException is thrown.

 

更多相关文章

  1. Android(安卓)AbsListView
  2. Binder框架的一些简单总结(关于自定义服务中的Binder)
  3. 第九章:Android中的数据存取
  4. 关于android各种双卡手机获取imei,imsi的处置(mtk,展讯,高通等)
  5. android动态增加控件时控制样式的方法
  6. Android中UI线程与后台线程交互设计的5种方法
  7. Android(安卓)滑动绘制流程探究 系统是如何提高滑动性能?
  8. Android(安卓)大图压缩处理,避免OOM
  9. 像写Flutter一样开发Android原生应用

随机推荐

  1. android中intent传递数据的方式
  2. android check symbols in so
  3. 应用选择器
  4. Android(安卓)从入门到资深学习路线
  5. Windows下 BlackBerry & Google Android
  6. android TIPS小结
  7. Android图片缩放、圆角处理以及倒影特效
  8. 《Android编程实战》学习笔记二——在And
  9. android sdk 5.0下载步骤
  10. Android(安卓)架构组件 - 让天下没有难做