2

In order to open SIM PIN settings, I am using this code up to Android M. 7.0 SDK 24, Sim is inside the tray. ^^

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);

On Android N, I am getting à android.content.ActivityNotFoundException

Any Clue ?

divol
  • 192
  • 7

1 Answers1

0

Instead of "com.android.settings.IccLockSettings" try "$IccLockSettingsActivity"

If you use adb, don't forget to escape the $ wth a \:

am start -a android.intent.action.MAIN -n com.android.settings/.Settings\$IccLockSettingsActivity
alexislg
  • 1,018
  • 13
  • 20