I want to execute the command "pm grant com.example.xy android.permission.CHANGE_CONFIGURATION" inside the app.
Process p;
try {
p = Runtime.getRuntime().exec("pm grant com.example.xy android.permission.CHANGE_CONFIGURATION");
p.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = reader.readLine())!= null) {
output.append(line + "n");
Log.e("splash", "error " + output.append(line + "n"));
}
} catch (Exception e) {
Log.e("splash", "error " + e.toString());
e.printStackTrace();
}
String response = output.toString();
return response;
This have no effect. Have anyone a solution for this?