以编程方式打开特定的“设置”页面

Nyf*_*ul 3 android android-intent android-settings

在我的应用程序中,有什么方法可以将用户重定向到特定的设置“页面”?我的应用程序用作锁定屏幕应用程序,因此我希望能够将用户直接重定向到Android设置的“锁定屏幕”部分。(最好通过按钮或类似方式)

Nad*_*bal 5

ACTION_SECURITY_SETTINGS目的:

 Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
 startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

有关完整的设置意图


Nyf*_*ul 5

我设法在不久前的旧Stackoverflow 帖子中找到了正确答案。代码片段现在看起来像这样:

Intent intent = new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)