0

I am planning of creating an app as a background service which is triggered when the user selects a piture in the gallery.. Basically I want to make use of sensors to scroll between images.. For example..If the user shakes the phone it should display the next image in the gallery. Could anyone please help me out as to how to know whether the user is in gallery??

Thanks

1 Answer 1

1

By 'gallery' you mean the Gallery app that comes pre-installed in the device? If so, I don't think that what you are asking is possible.

Since Android apps run in sandbox, they can't communicate with each other unless you have the needed permissions, or API to do so. And I doubt the default Gallery app does anything sort of like that.

The best thing you could do, is write your own gallery app and implement that feature for it. Or even better take a good look at the default Gallery app's source, and extend it ;)

2
  • Thanks for your reply.. But i heard that this can be done using setCallbackDuringFling method.. Isn't it possible?? Jul 7, 2013 at 7:58
  • setCallbackDuringFling is a method of the Gallery class. That class is yet an other widget that can be used as a component in the layouts of your application (like Button, ImageView,ListView and so on). Although they share the same name, this class has nothing to do with the pre-installed application.
    – Alex Styl
    Jul 7, 2013 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.