For those with this problem, add this to AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Problem solved 😀
EDIT: If this does not work just make sure if path is correct
More Related Contents:
- File I/O Concept [closed]
- How do I create a Java string from the contents of a file?
- Android – Get real path of a .txt file selected from the file explorer
- How to read all files in a folder from Java?
- Create a file from a photo URI on Android
- How do I get the file extension of a file in Java?
- Quickly read the last line of a text file?
- byte[] to file in Java
- Encryption of video files?
- Difference between getExternalFilesDir and getExternalStorageDirectory()
- Elegant way to read file into byte[] array in Java [duplicate]
- Writing a file to sdcard
- Access resource files in Android
- Android : How to read file in bytes?
- How to move/rename file from internal app storage to external storage on Android?
- Test if file exists
- java IO to copy one File to another
- java read file from network device
- Create folder in Android [duplicate]
- How do I delete files programmatically on Android?
- read complete file without using loop in java
- How to break a file into pieces using Java?
- Get the file size in android sdk?
- java set file permissions to 777 while creating a file object [duplicate]
- How to reference a File in raw folder in Android
- Write and read multiple objects to file
- Test if a file is an image file
- Accessing files with spaces in filename from Java
- Android: Non-static method cannot be referenced from static context. Confused? [duplicate]
- How to add a push notification in my own android app