0

enter image description hereThis is my code for capturing image:

{
                        PackageManager pm = getPackageManager();
                        if (pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
                            Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
                            i.putExtra(MediaStore.EXTRA_OUTPUT, MyFileContentProvider.CONTENT_URI);
                            startActivityForResult(i, REQUEST_IMAGE_CAPTURE_REDMI);
                        }

If I use this a duplicate image is storing in DCIM folder.How can I avoid to store image in DCIM folder while using Content Provider?

user
  • 11
  • 5
  • MyFileContentProvider.CONTENT_URI can you post the value of this parameter – Parth Dave Oct 06 '16 at 10:33
  • @Parth DaveI have edited my question with the result. – user Oct 06 '16 at 10:57
  • MyFileContentProvider.CONTENT_URI what's the value of this variable Control click on this variable and let me know if is it file or is it folder path? – Parth Dave Oct 06 '16 at 11:01
  • @Parth Dave public static final Uri CONTENT_URI = Uri.parse("content://com.example.user.studentadmission/"); inside MyFileContentProvider class which extends ContentProvider – user Oct 06 '16 at 11:05
  • give a file path there like /sdcard/yourfolder/timestamp.jpg and it will work fine – Parth Dave Oct 06 '16 at 11:14
  • @Parth Dave I dont want to save it in sdcard. – user Oct 06 '16 at 11:17
  • then follow this post: http://stackoverflow.com/questions/18711525/camera-not-working-saving-when-using-cache-uri-as-mediastore-extra-output – Parth Dave Oct 06 '16 at 11:22

0 Answers0