My app should open Mobile Network Settings activity. Everything works fine except devices with Android 4.1 which crash after attempt to open Settings
Intent intent = new Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
final ComponentName cName = new ComponentName("com.android.phone", "com.android.phone.Settings");
intent.setComponent(cName);
startActivity(intent);
Stack trace after crashing:
java.lang.SecurityException: Permission Denial: starting Intent { act=android.settings.DATA_ROAMING_SETTINGS cmp=com.android.phone/.Settings } from ProcessRecord{41b83198 ...
Any ideas? Could it be because of the manifest?
UPDATE:
Seem that the problem was solved here: Android - Mobile network settings menu (Jelly Bean)
The thing is to change "com.android.phone.Settings" to "com.android.phone.MobileNetworkSettings"
I think you have to try
Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);
This thing is working for me in android 4.1.2, might be they fixed this issue in 4.1.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With