CODE:
ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
requestPermissions(new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE }, 1);
driverList = new ArrayList < > ();
file = new File(Environment.getExternalStorageDirectory().toString() + "/drivers.json");
if (!file.exists()) {
try {
file.createNewFile();
ServerTask st = new ServerTask("2019", true);
st.execute();
} catch (IOException e) {
e.printStackTrace();
}
} else {
load();
}
So I have this code and after I have installed the app and I was asked for the permission the App doesn't continue. I always accept the permission
The code you have provided here only states the checks on the required permissions anda call to request them. Please post the code for requestPermissions
method
Also try the following
If you have already done that then pls post that code snippet here.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.