美文网首页
打开设置选项

打开设置选项

作者: Tenny1225 | 来源:发表于2015-12-26 11:02 被阅读352次

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

           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)
    

    相关文章

      网友评论

          本文标题:打开设置选项

          本文链接:https://www.haomeiwen.com/subject/incbhttx.html