How to open System Data Usage Activity in android?

2019-01-26 21:49发布

问题:

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

回答1:

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



回答2:

Here is Android Intents and find ACTION_MANAGE_NETWORK_USAGE Intent.

Also may be this link will help you.