Hi,

I'm trying to detect when new photos are taken and saved. I've tried
to use a BroadcastReceiver but haven't had any luck. It just doesn't
get called. This is what I have so far:

AndroidManifest.xml

...
                <receiver android:name="NewPhotoReceiver">
                        <intent-filter>
                                <action 
android:name="com.android.camera.NEW_PICTURE"/>
                        </intent-filter>
                </receiver>

-----------------------------------
NewPhotoReceiver.java

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

public class NewPhotoReceiver extends BroadcastReceiver
{
        @Override
        public void onReceive(Context context, Intent intent)
        {
                Log.i(TAG, "Received new photo");
                Toast.makeText(context, "New photo available",
Toast.LENGTH_SHORT).show();
        }

        private static final String     TAG = "NewPhotoReceiver";
}

I found the broadcast action in the Camera source code on android.com.
If this isn't the correct way, can anyone point me in the right
direction? My next steps would be to run a small app at startup and
watch the /sdcard/dcim/camera/ directory which is a pain.

Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to