How to open System Data Usage Activity in android?

北慕城南 提交于 2019-12-29 08:10:01

问题


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.



来源:https://stackoverflow.com/questions/20489414/how-to-open-system-data-usage-activity-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!