setOnItemClickListener没有得到所谓的 [英] setOnItemClickListener not getting called
本文介绍了setOnItemClickListener没有得到所谓的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的onCreate方法如下:
I have this in the onCreate method as follows:
ListView lv = (ListView)findViewById(android.R.id.list);
adapter = new ModuleAdapter(this);
lv.setAdapter(adapter);
lv.setOnItemClickListener(this);
再后来在code:
Then later in the code:
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
// TODO Auto-generated method stub
Log.v(TAG, "clicked");
}
OnItemClickListener正在实施中。
OnItemClickListener is being implemented.
我想火从onItemClick一个新的活动,但它似乎没有奏效。
I'm trying to fire a new activity from onItemClick but it does not appear to be working.
新到Android,不知道很多java。任何人都可以帮忙吗?谢谢你。
New to Android and don't know a lot of java. Can anyone help? Thanks.
推荐答案
试试这个改变了xxx_row.xml
Try this changes in the xxx_row.xml
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:enabled="false">
</TextView>
至少对于我来说它的工作时,我改变了宽度和enabled属性。
At least for me it worked when i changed the width and enabled attributes.
这篇关于setOnItemClickListener没有得到所谓的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文