小编Ale*_*lex的帖子

Android 4.1中的移动网络设置

我的应用应该打开移动网络设置活动.一切正常,但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);
Run Code Online (Sandbox Code Playgroud)

崩溃后的堆栈跟踪:

java.lang.SecurityException: Permission Denial: starting Intent { act=android.settings.DATA_ROAMING_SETTINGS cmp=com.android.phone/.Settings } from ProcessRecord{41b83198 ...
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?可能是因为清单?

更新:

似乎问题在这里解决了: Android - 移动网络设置菜单(Jelly Bean)

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

settings android android-intent

6
推荐指数
1
解决办法
4954
查看次数

不推荐使用KeyPairGeneratorSpec

自API 23开始不推荐使用KeyPairGeneratorSpec。如何处理此警告?

示例代码:

KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "AndroidKeyStore");
kpg.initialize(new KeyPairGeneratorSpec.Builder(context).build());
Run Code Online (Sandbox Code Playgroud)

security android

5
推荐指数
1
解决办法
5483
查看次数

标签 统计

android ×2

android-intent ×1

security ×1

settings ×1