Android 4.1中的移动网络设置

Android 4.1中的移动网络设置,android,android-intent,settings,Android,Android Intent,Settings,我的应用程序应打开“移动网络设置”活动。除了安卓4.1的设备在尝试打开设置后崩溃外,其他一切都正常 Intent intent = new Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS); final ComponentName cName = new ComponentName("com.android.phone", "com.android.phone.Settings"); intent.setComponen

我的应用程序应打开“移动网络设置”活动。除了安卓4.1的设备在尝试打开设置后崩溃外,其他一切都正常

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);
崩溃后的堆栈跟踪:

java.lang.SecurityException: Permission Denial: starting Intent { act=android.settings.DATA_ROAMING_SETTINGS cmp=com.android.phone/.Settings } from ProcessRecord{41b83198 ...
有什么想法吗?可能是因为舱单的缘故吗

更新:

问题似乎在这里解决了:


问题是将“com.android.phone.Settings”更改为“com.android.phone.MobileNetworkSettings”

我想你必须试试

Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);
这个东西在android 4.1.2中对我有效,
他们可能在4.1.2中解决了这个问题,因为问题是在Nexus S上发现的,您在什么设备上测试这个问题