I saw many posts in StackOverflow regarding how to listen to camera events, and got few information but still there are few questions remain in my mind please let me know the answers for these:
I have an application which have a broadcast receiver and my broadcast receiver will lauch my activity, but the main purpose of having broadcast receiver is to listen to camera photo/video capture intent.
I want to know which is the intent i have to listen for this, and is it possible to do in this way.
thanks
For Receiving camera photo capture intent, try following code
public class CameraEventReciver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "New Photo Clicked", Toast.LENGTH_LONG).show();
}
and in manifest, register the receiver:-
<uses-permission android:name="android.permission.CAMERA" />
<receiver
android:name="com.android.application.CameraEventReciver"
android:enabled="true" >
<intent-filter>
<action android:name="com.android.camera.NEW_PICTURE" />
<data android:mimeType="image/*" />
</intent-filter>
</receiver>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With