Source:
<code>public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key.equals("passSetting")) { ListPreference itemList = (ListPreference) findPreference("passSetting"); final ListPreference patternMaxTry = (ListPreference) findPreference("patternMax"); final CheckBoxPreference stealthMode = (CheckBoxPreference) findPreference("stealthMode"); stealthMode.setEnabled(false); patternMaxTry.setEnabled(false); switch (itemList.getValue()) { case "p0": confirmResetPasswords(itemList); break; case "p1": showPasswordActivity(itemList); break; case "p2": showPatternActivity(); break; } if(FingerprintUtil.isAndroidSupport()){ checkFingerprintDeviceSupport(); }else{ if(itemList != null) { <START> itemList.setValueIndex(0); <END> } Api.toast(globalContext, getString(R.string.your_android_version_not_support_fingerprint)); } } if (key.equals("enableAdmin")) { boolean value = G.enableAdmin(); if (value) { Log.d("Device Admin Active ?", mDPM.isAdminActive(deviceAdmin) + ""); if (!mDPM.isAdminActive(deviceAdmin)) { Intent intent = new Intent( DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN); intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, deviceAdmin); intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, getString(R.string.device_admin_desc)); startActivityForResult(intent, REQUEST_CODE_ENABLE_ADMIN); } } else { if (mDPM.isAdminActive(deviceAdmin)) { mDPM.removeActiveAdmin(deviceAdmin); Api.toast(this.getActivity().getApplicationContext(), getString(R.string.device_admin_disabled), Toast.LENGTH_LONG); } } } if (key.equals("enableStealthPattern")) { AlpSettings.Display.setStealthMode(this.getActivity().getApplicationContext(), G.enableStealthPattern()); } }</code><technical_language>resetting password if FingerPrint is supported. usecase if user someother option</technical_language>

Target:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key.equals("passSetting")) { ListPreference itemList = (ListPreference) findPreference("passSetting"); final ListPreference patternMaxTry = (ListPreference) findPreference("patternMax"); final CheckBoxPreference stealthMode = (CheckBoxPreference) findPreference("stealthMode"); stealthMode.setEnabled(false); patternMaxTry.setEnabled(false); switch (itemList.getValue()) { case "p0": confirmResetPasswords(itemList); break; case "p1": showPasswordActivity(itemList); break; case "p2": showPatternActivity(); break; } if(FingerprintUtil.isAndroidSupport()){ checkFingerprintDeviceSupport(); } } if (key.equals("enableAdmin")) { boolean value = G.enableAdmin(); if (value) { Log.d("Device Admin Active ?", mDPM.isAdminActive(deviceAdmin) + ""); if (!mDPM.isAdminActive(deviceAdmin)) { Intent intent = new Intent( DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN); intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, deviceAdmin); intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, getString(R.string.device_admin_desc)); startActivityForResult(intent, REQUEST_CODE_ENABLE_ADMIN); } } else { if (mDPM.isAdminActive(deviceAdmin)) { mDPM.removeActiveAdmin(deviceAdmin); Api.toast(this.getActivity().getApplicationContext(), getString(R.string.device_admin_disabled), Toast.LENGTH_LONG); } } } if (key.equals("enableStealthPattern")) { AlpSettings.Display.setStealthMode(this.getActivity().getApplicationContext(), G.enableStealthPattern()); } }