What intention should open the data usage screen (from settings)

I want to open the "Data Usage" screen from intent. I was looking for the android.provider.Settings class for the corresponding intent. I tried:

new Intent(android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS) new Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS) 

This does not lead to the use of data.

enter image description here

I know all the links that have this question well, but no one has the answer. How to open system data usage activity in android? Android to open the data usage settings page , etc ...

+7
android android-intent android-settings
source share
2 answers

You can use this to achieve the above! I tested this on Kitkat and lollipop devices, both of which worked

  Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.settings","com.android.settings.Settings$DataUsageSummaryActivity")); startActivity(intent); 
+17
source share
 private static final String SETTINGS_PACKAGE = "com.android.settings"; private static final String SETTINGS_CLASS_DATA_USAGE_SETTINGS = "com.android.settings.Settings$DataUsageSummaryActivity"; try { final Intent intent = new Intent(Intent.ACTION_MAIN, null); final ComponentName cn = new ComponentName(SETTINGS_PACKAGE, SETTINGS_CLASS_DATA_USAGE_SETTINGS); intent.setComponent(cn); context.startActivity(intent); } catch (ActivityNotFoundException e) { Log.v(TAG, "Data settings usage Activity is not present"); } 
+1
source share

All Articles