android Programming Glossary: getlastimageid
Built-in Camera, using the extra MediaStore.EXTRA_OUTPUT stores pictures twice (in my folder, and in the default) http://stackoverflow.com/questions/6341329/built-in-camera-using-the-extra-mediastore-extra-output-stores-pictures-twice delete the duplicated image. It can be done like that Gets the last image id from the media store @return private int getLastImageId final String imageColumns MediaStore.Images.Media._ID MediaStore.Images.Media.DATA final String imageOrderBy MediaStore.Images.Media._ID.. String fullPath imageCursor.getString imageCursor.getColumnIndex MediaStore.Images.Media.DATA Log.d TAG getLastImageId id id Log.d TAG getLastImageId path fullPath imageCursor.close return id else return 0 And to remove the file private void.. imageCursor.getString imageCursor.getColumnIndex MediaStore.Images.Media.DATA Log.d TAG getLastImageId id id Log.d TAG getLastImageId path fullPath imageCursor.close return id else return 0 And to remove the file private void removeImage int id ContentResolver..
Get Path and Filename from Camera intent result http://stackoverflow.com/questions/7636697/get-path-and-filename-from-camera-intent-result You can obtain the last picture taken doing that Gets the last image id from the media store @return private int getLastImageId final String imageColumns MediaStore.Images.Media._ID MediaStore.Images.Media.DATA final String imageOrderBy MediaStore.Images.Media._ID.. String fullPath imageCursor.getString imageCursor.getColumnIndex MediaStore.Images.Media.DATA Log.d TAG getLastImageId id id Log.d TAG getLastImageId path fullPath imageCursor.close return id else return 0 This sample was based on post Deleting.. imageCursor.getString imageCursor.getColumnIndex MediaStore.Images.Media.DATA Log.d TAG getLastImageId id id Log.d TAG getLastImageId path fullPath imageCursor.close return id else return 0 This sample was based on post Deleting a gallery image after camera..
|