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
Restart your device. Open your Settings app and tap Network & internet or Connections. Depending on your device, these options may be different. Turn Wi-Fi off and mobile data on, and check if there's a difference. If not, turn mobile data off and Wi-Fi on and check again.
If your app displays a network error message, try the following: Turn the Wi-Fi off by tapping Settings > Wi-Fi > Off. Turn off Airplane Mode by tapping Settings > Airplane Mode > Off. Turn Cellular Data on by tapping Settings App > Wireless & Networks (header) > More… > Mobile Networks > Data Enabled.
Settings > Network & Internet > More > Mobile Networks > Network operators > Search networks > Select your mobile network. Restart your phone. You may also select Network operator automatically until the message Registered on network appears at the bottom of the screen.
The “Network error, please try again later” toast message is caused by a faulty app, particularly, an app working in the background. Previously, I tracked the error's pattern and noticed that it always displayed when I used a Google app.
To get this working, change your intent creation to the following code:
Intent intent=new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
ComponentName cName = new ComponentName("com.android.phone","com.android.phone.Settings");
intent.setComponent(cName);
Basically the android manifest requires a component filter.
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