Android OnItemClick listener Not Working in ListView?
I am developing an application with list-view, which consists of check box as well as Rating bar, here my problem is while i am clicking on arrow button or on listview on item click listener is not working for me? any one can help me i am trying for longtime........
ListView lv = getListView();
lv.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,int position, lon开发者_JAVA百科g arg3)
{
Toast.makeText(SuggestionActivity.this, "" + position, Toast.LENGTH_SHORT).show();
}
});
}
use this
ListView lv = getListView();
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v,int position, long id) {
});
}
This is because of your layout items. Try to disable the clickability of them using these:
android:focusable="false"
android:focusableInTouchMode="false"
精彩评论