Hi I would like to open the mobile network settings with this code:
Intent intentSettings = new Intent();
intentSettings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intentSettings.setAction(Settings.ACTION_DATA_ROAMING_SETTINGS);
cont.startActivity(intentSettings);
but it gives me this error. Any ideas anyone?
12-10 11:17:34.902: ERROR/AndroidRuntime(623): android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.settings.DATA_ROAMING_SETTINGS flags=0x4000000 }
Thanks
This works the same for the ACTION_NETWORK_OPERATOR_SETTINGS, just add the following component:
Intent intent=new Intent(Settings.ACTION_NETWORK_OPERATOR_SETTINGS);
ComponentName cName = new ComponentName("com.android.phone","com.android.phone.Settings");
intent.setComponent(cName);
To get this working, change your intent creation to the following code:
Basically the android manifest requires a component filter.
You could try getting rid of the
FLAG_ACTIVITY_NEW_TASK
, which may not be needed in this case, and see if that helps.If that does not help, then either:
UPDATE
It appears the answer is the third bullet above. While
ACTION_DATA_ROAMING_SETTINGS
is in the documentation, the Settings application itself does not have an<intent-filter>
for it.I will check back when the Android 2.3 source is released and see if that changes the story any. If not, I will file a bug, because either it is a documentation error or a Settings application error, IMHO.