【发布时间】:2012-08-22 05:57:16
【问题描述】:
我的应用应该打开移动网络设置活动。一切正常,除了 Android 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 ...
有什么想法吗?会不会是清单的原因?
更新:
看来问题在这里解决了: Android - Mobile network settings menu (Jelly Bean)
问题是将“com.android.phone.Settings”更改为“com.android.phone.MobileNetworkSettings”
【问题讨论】:
-
问题是在 Nexus S 上发现的
标签: android android-intent settings