views:

332

answers:

1

I want to have a background service running which gets started when an Image is opened in the gallery and then does something fancy with the image... As far as I know the opening of the image in the gallery would trigger a new intent to display this image. (Correct me if I'm wrong). My idea was to catch that Intent in the intent filter of said service I want to implement.

Here's my intent filter from the manifest:

<service android:name=".MyService">
<intent-filter> 
<action android:name="android.intent.action.PICK" /> 
<category android:name="android.intent.category.DEFAULT"  /> 
<data android:path="/external/images/media" android:scheme="content" /> 
</intent-filter>
</service>

This intent filter does not work and I don't know why. What is the correct intent filter/how can I find it?

+1  A: 

What is the correct intent filter/how can I find it?

You can't do this. You cannot intercept an Intent used to start an Activity.

CommonsWare
Then what other ways do I have to "listen" to this kind of event? When the image gets opened in the gallery I want to transmit it via the network to a local computer.
'Then what other ways do I have to "listen" to this kind of event?" You don't and can't. "When the image gets opened in the gallery I want to transmit it via the network to a local computer." You are welcome to write your own gallery-style application that has this functionality.
CommonsWare