Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileUriExposedException #23

Closed
chnouman opened this issue Apr 16, 2018 · 3 comments
Closed

FileUriExposedException #23

chnouman opened this issue Apr 16, 2018 · 3 comments

Comments

@chnouman
Copy link

Caused By : android.os.FileUriExposedException: file:///storage/emulated/0/DCIM/IMG1436838936.jpg exposed beyond app through ClipData.Item.getUri()

                                                                            android.os.StrictMode.onFileUriExposed(StrictMode.java:1799)
                                                                            android.net.Uri.checkFileUriExposed(Uri.java:2346)
                                                                            android.content.ClipData.prepareToLeaveProcess(ClipData.java:832)
                                                                            android.content.Intent.prepareToLeaveProcess(Intent.java:9483)
                                                                            android.content.Intent.prepareToLeaveProcess(Intent.java:9468)
                                                                            android.app.Instrumentation.execStartActivity(Instrumentation.java:1525)
                                                                            android.app.Activity.startActivityForResult(Activity.java:4399)
                                                                            android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
                                                                            android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:67)
                                                                            android.app.Activity.startActivityForResult(Activity.java:4358)
                                                                            android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:732)
                                                                            com.zfdang.multiple_images_selector.ImagesSelectorActivity.launchCamera(ImagesSelectorActivity.java:370)
                                                                            com.zfdang.multiple_images_selector.ImagesSelectorActivity.requestCameraRuntimePermissions(ImagesSelectorActivity.java:177)
                                                                            com.zfdang.multiple_images_selector.ImagesSelectorActivity.onImageItemInteraction(ImagesSelectorActivity.java:352)
                                                                            com.zfdang.multiple_images_selector.ImageRecyclerViewAdapter$1.onClick(ImageRecyclerViewAdapter.java:100)
                                                                            android.view.View.performClick(View.java:6205)
                                                                            android.view.View$PerformClick.run(View.java:23653)
                                                                            android.os.Handler.handleCallback(Handler.java:751)
                                                                            android.os.Handler.dispatchMessage(Handler.java:95)
                                                                            android.os.Looper.loop(Looper.java:154)
                                                                            android.app.ActivityThread.main(ActivityThread.java:6682)
                                                                            java.lang.reflect.Method.invoke(Native Method)
                                                                            com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
                                                                            com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
@app-arianamini
Copy link

Has anyone solved the problem?

@zfdang
Copy link
Owner

zfdang commented Nov 29, 2018

android-multiple-images-selector/multiple-images-selector/src/main/java/com/zfdang/multiple_images_selector/ImageRecyclerViewAdapter.java

Line 49: newURI = Uri.fromFile(imageFile);

can you try to change it to:

newURI = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".my.package.name.provider", imageFile);

@zfdang zfdang closed this as completed Nov 30, 2018
@zfdang
Copy link
Owner

zfdang commented Nov 30, 2018

fixed

@zfdang zfdang reopened this Nov 30, 2018
@zfdang zfdang closed this as completed Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants