0

When i call de image from storage (Firebase) i have this error:

> "java.lang.SecurityException: Permission Denial: opening provider
> com.android.providers.media.MediaDocumentsProvider from ProcessRecord
> requires that you obtain access using ACTION_OPEN_DOCUMENT or related
> APIs"

I want do a recyclerview with all users and i receive all information (name and other informations about users) but images not. I call information on Adapter for recyclerview:

 @Override
public void onBindViewHolder(@NonNull SearchViewHolder searchViewHolder, int position) {
    searchViewHolder.tv_title.setText(mData.get(position).getUsername());
    searchViewHolder.tv_content.setText(mData.get(position).getUserEmail());
    Glide.with(mContext).load(mData.get(position).getUserimg()).into(searchViewHolder.img_user_final);
    Log.d("teste", mData.get(position).getUserimg());

}
Siong Thye Goh
  • 3,518
  • 10
  • 23
  • 31
  • https://stackoverflow.com/questions/43430743/permission-denial-opening-provider-com-android-providers-media-mediadocumentspr – Eder Padilla May 28 '19 at 15:17
  • @EderPadilla is a different question. I have a code on Adapter and i doesn't use Bitmap – user9822783 May 28 '19 at 15:24
  • And i doesn't want to open Gallery, i only want receive a image from Firebase.. – user9822783 May 28 '19 at 15:27
  • Im guessing you need to get permission from the user? https://developer.android.com/guide/topics/permissions/overview – Zee May 29 '19 at 09:23
  • @Zee for example? I have this permissions: – user9822783 May 29 '19 at 09:56
  • Hmm, ok apparently you might not need a user permission for this particular permission. BUT, there seems to be other people with the same issue: https://stackoverflow.com/questions/48187647/exception-java-lang-securityexception-reading-mediadocumentsprovider-requ and https://stackoverflow.com/questions/46916992/having-trouble-implementing-action-open-document-to-my-project/46917304 Maybe something to do with takePersistableUriPermission() in particular – Zee May 29 '19 at 11:05
  • I found my error, when i save images on firebase the url is: "content://com.android.providers.media...." and for download the url is "https://firebasestorage....." so, when i call image i don´t see because the url is not a correct for download. The problem is when i save the user image. You can help me? I don´t know why the url is the different between url download and url storage – user9822783 May 29 '19 at 13:08

0 Answers0