0

I've got a GridView that works ok on Android 2.x but from 4.x up, does not detect item click. Anyone knows if there is a specific change in GridView from Android 4.x up that can affect this?

The code is summarized from many classes:

listAdapter = createAdapter();
gridView = (GridView) findViewById(R.id.gridView); 
gridView.setClickable(true);
gridView.setFocusable(true);
gridView.setOnItemClickListener(this);
gridView.setAdapter(listAdapter);

...

public View getView(int index, View convertView, ViewGroup arg2)
{
...
convertView = inflater.inflate(R.layout.gallery_list_item, null);
convertView.setFocusable(false);
convertView.setClickable(false);
convertView.setTag(holder);

Thanks

Cheborra
  • 2,627
  • 4
  • 23
  • 39

1 Answers1

0

Ok, found it.

Turns out it was using an old version of "android-pulltorefresh" lib, and it has a documented bug that you can fix adding just a line of code (or update the lib to latest, of course).

The solution is documented here.

Apparently this is only a problem in Android 4.x +

Short story (for future viewers) is:

 @Override
 protected void onAttachedToWindow()
 {
 ADD THIS--->     super.onAttachedToWindow();
...
Cheborra
  • 2,627
  • 4
  • 23
  • 39