protected fun createUserDictionaryPreference( locale: String?, activity: Activity?  ): Preference? { val newPref = Preference(getActivity()) val intent = Intent(USER_DICTIONARY_SETTINGS_INTENT_ACTION) if (null == locale) { newPref.title = Locale.getDefault().displayName } else { if ("" == locale) newPref.title = getString(R.string.user_dict_settings_all_languages) else newPref.setTitle( Utils.createLocaleFromString( locale ).getDisplayName() ) intent.putExtra("locale", locale) newPref.extras.putString("locale", locale) } newPref.intent = intent newPref.fragment = com.android.settings.UserDictionarySettings::class.java.getName() return newPref }
Create a single User Dictionary Preference object , with its parameters set .