I\'m working on an Android application which needs to perform an action each time a new image is taken with the phone. I don\'t want to take the image within my application
Quite an old question, if anyone still needs the solution try using
android.hardware.action.NEW_PICTURE
as your intent filter
<!-- Receiver for camera clicks -->
<receiver
android:name=".receivers.CameraEventReceiver"
android:label="CameraEventReceiver">
<intent-filter>
<!-- <action android:name="com.android.camera.NEW_PICTURE" /> -->
<action android:name="android.hardware.action.NEW_PICTURE" />
<data android:mimeType="image/*" />
</intent-filter>
</receiver>
It will return the Uri of the image in intent.getData() of its onReceive() function
Hope it helps
try this one this works for me
<receiver android:name=".pictureReceiver" >
<intent-filter android:priority="10000" >
<action android:name="android.intent.action.CAMERA_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
Right now, I've gotten a BroadcastReceiver implemented that's currently listening for "android.intent.action.CAMERA_BUTTON". However, this doesn't seem to get called when I'm wanting it to.
That only gets broadcast if the foreground activity does not consume the event.