Open specific Settings-page programmatically

大兔子大兔子 提交于 2019-12-10 21:55:33

问题


Is there any way to, in my app, to redirect a user to a specific settings 'page'? My app works as a lock screen app, so I want to be able to redirect the user directly to the "Lock Screen" section of the Android settings. (Preferably via a button or something similar)


回答1:


ACTION_SECURITY_SETTINGS Intent:

 Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
 startActivity(intent);

For complete Settings Intents




回答2:


I managed to find the correct answer in an old Stackoverflow-post from a while back. The code snippet now looks like this:

Intent intent = new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD);
startActivity(intent);


来源:https://stackoverflow.com/questions/38889399/open-specific-settings-page-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!