2

Possible Duplicate:
how to disable fling in android gallery

I have an Activity class with a Gallery widget and some more widgets. That class extends Activity. Now I want to stop fling attribute which is in Gallery.

Is there any Listener interface or something like that which I can get help to stop Flinging of the Gallery when I need.

Community
  • 1
  • 1
AnujAroshA
  • 4,275
  • 6
  • 46
  • 90

1 Answers1

1

There is a way to achieve this without overwriting the gallery, but this will also stop all other onTouch Events.

Put your Gallery inside a RelativeLayout and create another View that lies over the whole gallery view as a transparent layer.

You now need to overwrite the onInterceptTouch method of this View and return true. Now all touch events should be intercepted in your view and the gallery will not get any touch events that it can use to start a fling.

Janusz
  • 176,216
  • 111
  • 293
  • 365