Created
October 13, 2019 19:08
-
-
Save Ahmedbadereldin/eb46757cc587c4823a4c0f5c54521c6b to your computer and use it in GitHub Desktop.
When I needed to arrive for the first time to storage in Android 10 , I met many problems from this probleams : Knowing that these problems after I give the permission.
This file contains 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
When I needed to arrive for the first time to storage in Android 10 , I met many problems from this probleams : | |
Knowing that these problems after I give the permission. | |
* in this example using media-picker-android libray | |
Link : https://github.com/iamthevoid/media-picker-android | |
1- open failed: EACCES (Permission denied) | |
* when you show this probleam you need added this lines in your mainfist | |
<application | |
... | |
android:requestLegacyExternalStorage="true" | |
... | |
> | |
<provider | |
android:name="androidx.core.content.FileProvider" | |
android:exported="false" | |
android:grantUriPermissions="true" | |
tools:replace="android:authorities" | |
android:authorities="com.yourpakage.yourpakage.fileprovider"> | |
<meta-data | |
android:name="androidx.support.FILE_PROVIDER_PATHS" | |
android:resource="@xml/file_paths" /> | |
</provider> | |
--------------------------------------------- | |
file_paths.xml add in res->xml file | |
<?xml version="1.0" encoding="utf-8"?> | |
<paths> | |
<external-path | |
name="my_images" | |
path="Android/data/com.ennervoice.user/files/Pictures" /> | |
</paths> | |
--------------------------------------------- | |
hint in this example using android x | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment