I have an app HTMLSpyII that I developed a few years ago when I was an absolute beginner at Android programming. Anyway here it is a few years later, I have been away from programming through this time, it has been running on my Samsung S4 mini KitKat 4.4.2, but it will not run on my Samsung Tab E Nougat 7.1.1. I am certain that I am missing something simple.
The program is trying to create a directory /HTMLSpyII/Jsoup in the Downloads directory of the device. It outputs this two-line runTimeAlert from the last line of the following code snippet...
Unable to create path
/storage/emulated/0/Download/HTMLSpyII/Jsoup
Here is the code snippet, which is part of onCreate...
private File root;
private String urlString, tokenString;
private EditText url, token;
...
root = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_DOWNLOADS + "/HTMLSpyII/Jsoup");
Bundle extras = getIntent().getExtras();
if (extras != null) {
urlString = extras.getString("urlKey");
url.setText(urlString);
tokenString = extras.getString("tokenKey");
token.setText(tokenString);
if (getIntent().hasExtra("redirectsKey"))
followRedirects = extras.getBoolean("redirectsKey");
else
followRedirects = true;
if (getIntent().hasExtra("rootKey"))
root = new File (extras.getString("rootKey"));
}
if (!root.exists()) root.mkdirs();
if (!root.isDirectory())
runTimeAlert("Unable to create path\n" + root.toString())
Hope you can help :)