各位大虾小弟弱弱的问一下如何才能获取listview中的view呢? 各位大虾小弟弱弱的问一下如何才能获取listview中的view呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 看看这个http://download.csdn.net/source/3120614 给ListView中的View(如TextView、Button等)附上ID,通过ID获取View的对象:如:TextView textView= (TextView) listView.findViewById(R.id.tv); 我是用的 HashMap<String ,String > map1=new HashMap<String,String>(); map1.put("subject", cursor.getString(cursor.getColumnIndex("subject"))); map1.put("date", cursor.getString(cursor.getColumnIndex("date"))); list.add(map1); } SimpleAdapter listAdapter=new SimpleAdapter(this, list, R.layout.subjectlist, new String[]{"subject","date"}, new int[]{R.id.lsubject,R.id.ldate}); setListAdapter(listAdapter);向listview中添加的数据(主题和日期),我想在listview的onListItemClick事件中获取相应点击的数据(主题和日期),怎么才能实现这种方法。 哦。参考 http://www.beijibear.com/?aid=341-- android ListView添加事件并获取选中项的值 【100分】征android客户端版本升级设计方案 如何删除文件夹中所有数据 急求,线程问题,求解释.. 布局中ListView不断响应onScroll事件问题 今天写博格,文章中无法插入CODE代码片了,怎么回事? mac下配置android的adb环境变量 android4.4.2 中的email 研究问题,求指导呀! 安卓引入fragment之后,程序写法发生了变化,新写法写的应用能在旧版本上运行吗? android 实现弧形的gallery 请问各位大神这个问题怎么解决 android中gridview的点击事件 转行android!求解~~~~~~~~~~~~~~~
如:
TextView textView= (TextView) listView.findViewById(R.id.tv);
map1.put("subject", cursor.getString(cursor.getColumnIndex("subject")));
map1.put("date", cursor.getString(cursor.getColumnIndex("date")));
list.add(map1);
}
SimpleAdapter listAdapter=new SimpleAdapter(this, list, R.layout.subjectlist,
new String[]{"subject","date"}, new int[]{R.id.lsubject,R.id.ldate});
setListAdapter(listAdapter);向listview中添加的数据(主题和日期),我想在listview的onListItemClick事件中获取相应点击的数据(主题和日期),怎么才能实现这种方法。
-- android ListView添加事件并获取选中项的值