Getting an image in your application folder

93 Views Asked by At

In this application I want-> When user deletes any image from gallery, that image should copy in my application folder so later I'll show that deleted image to user.
Does that uses ContentProvider, ContentObserver, ContentResolver ??

If Yes then How??

public class Service extends android.app.Service {
    private static final String TAG = MyService.class.getSimpleName();

    @Override
    public void onCreate() {
        super.onCreate();
        getContentResolver().registerContentObserver(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, true, ab);
    }

    ContentObserver ab = new ContentObserver(new Handler()) {
        @SuppressLint("NewApi")
        @Override
        public void onChange(boolean z, Uri uri1) {

            /* Any changes on images from gallery, it will ping here . WHAT TO DO HERE ?? */

            super.onChange(z);
        }
    };

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
0

There are 0 best solutions below