Gridview touchscreen

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Gridview touchscreen

Postby freezemebaby » Wed Aug 05, 2009 2:11 pm

I use a Gridview.
I use onItemClick of OnItemClickListener to catch clicks.

My app works fine if I use the action keys in the emulator, but it ignores screen touches.

When I click the screen of my emulator the Gridview selector dissapears but nothing happens.

I thought the function onItemClick also included clicks done by pressing the touchscreen? What is the problem?
freezemebaby
Freshman
Freshman
 
Posts: 4
Joined: Wed Aug 05, 2009 2:06 pm

Top

Postby freezemebaby » Thu Aug 06, 2009 12:41 pm

I thought this would be an easy beginners question. Or is my question nog clear?
freezemebaby
Freshman
Freshman
 
Posts: 4
Joined: Wed Aug 05, 2009 2:06 pm

Postby freezemebaby » Thu Aug 06, 2009 1:12 pm

Fixed.

imageView.setClickable(true) was in one of the dispayed (image)views in the gridview.

If a subview of a view is clickable than the subview will get the click call, nog the superview. Should have thought about that. Changed it to imageView.setClickable(false) and all works fine.
freezemebaby
Freshman
Freshman
 
Posts: 4
Joined: Wed Aug 05, 2009 2:06 pm

Postby jah128 » Wed Aug 12, 2009 1:51 pm

freezemebaby wrote:Fixed.

imageView.setClickable(true) was in one of the dispayed (image)views in the gridview.

If a subview of a view is clickable than the subview will get the click call, nog the superview. Should have thought about that. Changed it to imageView.setClickable(false) and all works fine.


I have the same problem, I've a TabHost with 5 tabs and two of the tabs use a GridView which works with the cursor but not the touch. I've tried setting the 'setClickables' of the subviews to false but still no joy - any ideas? Its my first Android app so I may well be doing something silly, but I'm pretty stuck!
jah128
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Aug 12, 2009 1:45 pm

Postby freezemebaby » Thu Aug 13, 2009 9:08 pm

Same goes for setFocusable(boolean focusable), setting this to false may also help.
freezemebaby
Freshman
Freshman
 
Posts: 4
Joined: Wed Aug 05, 2009 2:06 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests