android - Remote removing admin rights for application -
how can remove administration rights (devicepolicymanager.removeactiveadmin(component name)) of application application. in particular, i've got working code uninstalling application other application:
intent removerintent = new intent(intent.action_delete); removerintent.setdata(packageuri); startactivity(removerintent);
but target app has admin rights, , wonder - can remove them same method, remove app?
you can't disable administrator rights other application.
but can show information dialog (to inform user disable admin rights). , start device admin settings using intent:
intent intent = new intent(); intent.setcomponent(new componentname("com.android.settings", "com.android.settings.settings$deviceadminsettingsactivity")); context.startactivity(intent);
it works me.
Comments
Post a Comment