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.