为了打开SIM卡引脚设置,我将此代码使用到Android M. 7.0 SDK 24,SIM位在托盘内。^^
Intent intent = new Intent(Intent.ACTION_MAIN);
ComponentName cn = new ComponentName("com.android.settings","com.android.settings.IccLockSettings");
intent.setAction("android.intent.action.VIEW");
intent.setComponent(cn);
startActivity(intent);
在Android n上,我得到了Android.content.contivitynotfoundexception
有任何线索?
而不是"com.android.settings.IccLockSettings"
尝试"$IccLockSettingsActivity"
如果您使用ADB,请不要忘记逃脱 $
wth a :
am start -a android.intent.action.MAIN -n com.android.settings/.Settings$IccLockSettingsActivity