1
我在我的项目中有一个列表视图,我为它分配onListitemClick监听器。onListItemClick不工作在Android 4.1.2
listView = (ListView) findViewById(R.id.mylist);
listView.setOnItemClickListener(this);
和我给听众为:
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Log.i("CLICK", "onListItemClick");
}
的点击动作采用的是Android 2.2以上版本的设备工作正常,除了为Android 4.1.2的设备。请帮我解决这个问题。在此先感谢..
可能是你的名单都有可聚焦的项目,如按钮,复选框,单选按钮etc..They使ListView控件失去重点,而不是你的clickable..show完成代码,让我们了解yoru问题 – Pragnani 2013-03-26 05:01:12
请参阅此链接http://stackoverflow.com/questions/15138716/in-listview-when-list-item-has-button-onlistitemclick-doesnt-work,http://stackoverflow.com/questions/13531404/android-onitemclicklistener-event-not-fired-when-page-is-swipped-fragmentactiv,http://stackoverflow.com/questions/15352486/cant-click-on-items-in-listview-with - 自定义适配器 – rajeshwaran 2013-03-26 05:01:45
可能是ev ent正被其他视图所占用,发布你的布局xmls,包括activity和list Item – Atrix1987 2013-03-26 05:24:22