I have a problem writing to the external storage in android simulator.
If you track down the BufferedOutputStream
in the attached screenshot. For some reason when I write to the internal storage, to cache, or external storage using getExternalFilesDir()
, that very same code works perfectly.
But when I try to write on the Public external storage using Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
that Buffer is always null. And when I to manually create the txt file where I'm saving the data, I receive the error in the screenshot below.
As per the screenshots, I've include Manifest code, the Activity class code, and screenshot from the emulator.