user2349990
user2349990

Reputation: 386

Android: How to know if the user has selected an image in gallery

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

Upvotes: 0

Views: 177

Answers (1)

Alex Styl
Alex Styl

Reputation: 4219

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 ;)

Upvotes: 1

Related Questions