How to open System Data Usage Activity in android?

2019-01-26 21:47发布

Can anybody tell me how to open Data usage from android settings from my app? I do not now which Intent I should call.

enter image description here

2条回答
男人必须洒脱
2楼-- · 2019-01-26 22:14

It works well for using the below code in my project:

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

And you can see the package info from here: https://github.com/CyanogenMod/android_packages_apps_Settings/blob/cm-12.0/AndroidManifest.xml

查看更多
干净又极端
3楼-- · 2019-01-26 22:24

Here is Android Intents and find ACTION_MANAGE_NETWORK_USAGE Intent.

Also may be this link will help you.

查看更多
登录 后发表回答