chinalwb / Android-Rich-text-Editor

Android Rich Text Editor With customized spans - 富文本编辑器 - Don't miss this one :)
Apache License 2.0
845 stars 166 forks source link

I'm this error while showing the text with image. java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider #128

Open MuhammadSaudKhan opened 3 years ago

MuhammadSaudKhan commented 3 years ago

I'm this error while showing the text with image. First time it will display the image correctly but when close the app reopen the app and want to see the text with image the app will crashed because of the following exception. Kindly guide me to solve this problem. Thanks java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider

chinalwb commented 3 years ago

Hi @MuhammadSaudKhan , sorry for the late response! Do you have your problem resolved now? Reading from the exception message: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider, it seems like it is caused by some permission issue, that is to say, you have to ask user for the document provider permissions, like the issue at here.

I'd like to see the exception details if you haven't yet figured it out.

Thanks.

rishabhk669 commented 3 years ago

@MuhammadSaudKhan , This error is because file is selected from gallery but while re-opening app doesn't have access to that URI location. So, you need to save image in some folder and put that URI in image path.