I want write settings permission in order to start portable WLAN hotspot...
this is what i got,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (!Settings.System.canWrite(getApplicationContext())) {
Intent intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS, Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, 200);
}
}
this works fine until i press back button after i grant permission.
after pressing back button resultCode is 0 always, therefore further code is not working properly.