打开设置选项

2015-12-26  本文已影响352人  Tenny1225

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

       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)
上一篇下一篇

猜你喜欢

热点阅读