打开设置选项

跳转到流量使用情况设置界面

       var intent =  Intent(Intent.ACTION_MAIN)
        intent.setComponent( ComponentName("com.android.settings",
                "com.android.settings.Settings\$DataUsageSummaryActivity"))
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
        startActivity(intent);

跳转到vpn界面

  startActivity( Intent("android.net.vpn.SETTINGS"));

电池管理界面

  var  powerUsageIntent =  Intent(Intent.ACTION_POWER_USAGE_SUMMARY)
        var resolveInfo = activity.packageManager.resolveActivity(powerUsageIntent, 0);
        // check that the Battery app exists on this device
        if(resolveInfo != null){
            startActivity(powerUsageIntent);
        }

打开关于设备界面

 var intent =  Intent(); intent.setClassName("com.android.settings", "com.android.settings.Settings\$DeviceInfoSettingsActivity")
startActivity(intent)

你可能感兴趣的:(打开设置选项)