I am creating a chat application in which I am uploading images and videos from the gallery like WhatsApp, but when I trying select image which is already downloaded by WhatsApp folder then I get this path
/storage/emulated/0/WhatsApp/Media/WhatsAppImages/IMG-20180717-WA0024.jpg
but when I read this to get real path to show image then I am getting this exception:
java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)
This is my provider
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
Below are the file path
<resources>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="/storage/emulated/0" path="."/>
</paths>
This happens only with WhatsApp media anyone please tell me the solution.
Thanks in advance