Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error opening mobile network settings menu

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

like image 546
dackyD Avatar asked Dec 10 '10 10:12

dackyD


People also ask

Why is my mobile network settings not working?

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.

Why does my Samsung phone keep saying network error?

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.

How do I fix my LG mobile network not available?

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.

Why does my phone keep saying network error please try again?

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.


1 Answers

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.

like image 190
Naresh Avatar answered Sep 19 '22 05:09

Naresh