CursorAdapter
来源:互联网 发布:网络英语培训机构排行榜 编辑:程序博客网 时间:2024/05/22 13:09
CursorAdapter
public class MyCursorAdapter extends CursorAdapter{ //必须重写的构造方法 public MyCursorAdapter(Context context,Cursor cursor,int flags){ super(context,cursor,flags); } /** 表示创建AdapterView的 item 的view对象 返回适配器控件中每个item对应的view对象 */ public View newView(Context context,Cursor cursor,ViewGroup parent){ View view=LayoutInflater.from(context).inflate(R.layout.activity.other,null); return view; } /** 绑定控件 */ public void bindView(View view,Context context,Cursor cursor){ TextView tv_id=(TextView)view.findViewById(R.id.tv_id); TextView tv_name=(TextView)view.findViewById(R.id.tv_name); TextView tv_age=(TextView)view.findViewById(R.id.tv_age); int id=cursor.getInt(cursor.getColumnIndex("_id")); String name=cursor.getString(cursor.getColumnIndex("name")); int age=cursor.getInt(cursor.getColumnIndex("age")); tv_id.setText(id+""); tv_name.setText(name); tv_age.setText(age+""); }}
0 0
- CursorAdapter
- CursorAdapter
- CursorAdapter
- cursoradapter
- CursorAdapter
- CursorAdapter
- cursorAdapter
- CursorAdapter
- CursorAdapter
- CursorAdapter
- CursorAdapter
- CursorAdapter简介
- cursorAdapter简介
- CursorAdapter优化
- CursorAdapter简介
- CursorAdapter使用
- Android CursorAdapter
- CursorAdapter 起步 (2)
- jsp学习札记————参数传值
- 机器学习笔记
- 【读书笔记】统计学:从数据到结论 第六章
- Numerical Measures in R
- Eclipse+Python开发环境搭
- CursorAdapter
- 耳机监听状态
- 南大软院大神养成计划--第十七天
- MIT app inventor 开发蓝牙发送app
- Josephus问题解决方法三(单向循环链表标识法)
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- swift中关于智能提示的问题
- leetcode -- Compare Version Numbers ---很基础,可以忽略
- node.js