Created
January 7, 2017 17:17
-
-
Save showsky/d6e0911ffcb6c03915b463daa749e256 to your computer and use it in GitHub Desktop.
Android FileProvider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .... | |
| String realFileUri = new File(AppHelper.getDirectoryPath(), AppHelper.getFileName() + ".jpeg"); | |
| mMediaUri = FileProvider.getUriForFile( | |
| getContext(), | |
| "com.nnnnnnn.provider", | |
| realFileUri | |
| ); | |
| Log.e("=====>", "Share URI: " + mMediaUri.toString()); | |
| Log.e("=====>", "Real File URI: " + realFileUri.toStrig()); | |
| Intent iCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
| iCamera.putExtra(MediaStore.EXTRA_OUTPUT, mMediaUri); | |
| startActivityForResult(iCamera, Constants.INTENT_CALL.CAPTURE_IMAGE); | |
| switch (requestCode) { | |
| case Constants.INTENT_CALL.CAPTURE_IMAGE: | |
| String filePath = SiliCompressor.with(getActivity()).compress(realFileUri.toString(), true); | |
| } | |
| .... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment