@Jan Malek I use this code to know if I have SD Card and get the path NO SD CARD
I then get the path for internal storage
public void onAvail() {
String state = Environment.getExternalStorageState();
if (state.equals(Environment.MEDIA_MOUNTED) && (!state.equals(Environment.MEDIA_MOUNTED_READ_ONLY))) {
File removable = ContextCompat.getExternalFilesDirs(this, null)[1];
THE_PATH = String.valueOf(removable) + "/Documents/";
//System.out.println("ALL TRUE ==> " + THE_PATH);
} else {// if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
THE_PATH = "";
//System.out.println("ALL FALSE ==> "+ THE_PATH);
}
}
Try these few lines of code I believe your path is incorrect in the code you posted if this does not work please advise us
Context context = this;
String removable = getFilesDir().getAbsolutePath();
THE_PATH = String.valueOf(removable)+"/";
System.out.println("INTERNAL PATH ======> "+THE_PATH);
File file = new File(context.getFilesDir(), "NAME_OF_FILE");
String PA = String.valueOf(file);
System.out.println("Where AM I ======> "+PA);