13-5-3 ListView内容的截取全攻略
来源:互联网 发布:ubuntu 复制 编辑:程序博客网 时间:2024/05/17 01:09
ListView内容的截取
ListView is a view group that displays a list of scrollable items. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database query and converts each item result into a view that's placed into the list.
其中adapter 有ArrayAdapter<T>, BaseAdapter, CursorAdapter, HeaderViewListAdapter, ListAdapter, ResourceCursorAdapter, SimpleAdapter, SimpleCursorAdapter, SpinnerAdapter, WrapperListAdapter
这里我不对adapter进行描述,不管是哪种adapter都是为了将每条信息显示在listview上
每条显示的位置都是自己设计好的UI位置,下面我主要讲的是当你单击其中一个item时,如何获取其对应item的内容。
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3)
public abstract void onItemClick (AdapterView<?> parent, View view, int position, long id)
Parameters
parent The AdapterView where the click happened.
view The view within the AdapterView that was clicked (this will be a view provided by the adapter)
position The position of the view in the adapter.
id The row id of the item that was clicked.
TextView temp=(TextView)arg1.findViewById(R.id.wifi_SSID);
ssid=temp.getText().toString();
通过第二个参数,获取当前item对象内容,因为第二个对象是当前事件的对象,可查阅当然目标内容。
************************************************************************************************
飞扬小米(记)
- 13-5-3 ListView内容的截取全攻略
- CString 截取字符串全攻略
- CString截取字符串全攻略
- CString截取字符串全攻略
- CString截取字符串全攻略
- CString截取字符串全攻略
- CString截取字符串全攻略
- CString截取字符串全攻略
- android下listview的优化和listview的异步加载全攻略(非常实用)
- 视觉内容全攻略:用科学、工具和策略制作让人中毒的图片
- 截取带HTML的内容
- 截取被遮住的内容
- java 内容的截取使用
- 截取屏幕的指定内容
- 终端服务的全攻略
- 入侵局域网的全攻略
- RecyclerView的使用全攻略
- 最全的listview
- MD5加密
- mysql遇到登录出现的问题
- 【左偏树+贪心】[Apio2012]dispatching
- C++第9周项目3 - 实现分数类中的运算符重载
- 神经网络算法的一个简单例子
- 13-5-3 ListView内容的截取全攻略
- 玩转微博营销葵花宝典
- 『MySQL』时间差
- 【java学习】对java反射的学习及参数赋值的研究
- FCKeditor总结
- linux网络编程:并发服务器的模型
- 手机支付宝密码存储机制分析
- javascript中必须使用var声明局部变量的情况
- hdu1698 Just a Hook(成段替换 lazy标记)