Skip to content Skip to sidebar Skip to footer

Gridview Setonitemclicklistener Does Not Respond To Clicks

I am trying to get the selected item in a GridView, but when I click on item, nothing happens. I don't get any logs from my log code: Log.i('postion', arg2+''); Here is my code: c

Solution 1:

I have had a similar problem. The way I solved it was adding the following lines to the getView() method in my adapter: btn.setFocusable(false); btn.setClickable(false); Where btn is the reference to the button.

Solution 2:

I guess your item view contains button or other view that got foucus. Try to set android:descendantFocusability="blocksDescendants" to item view like below:

<?xml version="1.0" encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="wrap_content"android:descendantFocusability="blocksDescendants" ><!-- item --></RelativeLayout>

Post a Comment for "Gridview Setonitemclicklistener Does Not Respond To Clicks"