@Override
 public void onItemSelected(
     final AdapterView<?> parent, final View view, final int pos, final long id) {
   final LocaleRenderer locale = (LocaleRenderer) parent.getItemAtPosition(pos);
   if (locale.isMoreLanguages()) {
     PreferenceActivity preferenceActivity = (PreferenceActivity) getActivity();
     preferenceActivity.startPreferenceFragment(new UserDictionaryLocalePicker(this), true);
   } else {
     mContents.updateLocale(locale.getLocaleString());
   }
 }
 // Called by the locale picker
 @Override
 public void onLocaleSelected(final Locale locale) {
   mContents.updateLocale(locale.toString());
   getActivity().onBackPressed();
 }
 @Override
 public void onNothingSelected(final AdapterView<?> parent) {
   // I'm not sure we can come here, but if we do, that's the right thing to do.
   final Bundle args = getArguments();
   mContents.updateLocale(args.getString(UserDictionaryAddWordContents.EXTRA_LOCALE));
 }