title: Determining if an Android preference was set previously
body: <p>I have an app which will have the UI text in different languages. I do not want to save this in the strings.xml, because I want the user to be able to change them (and not be dependant on the phone's locale).</p>
  
  <p>I've setup a preference to read this. By default, I want the UI to take the locale value, but if the user has changed the UI lang preference, I want it to use that.</p>
  
  <p>Is there any way to determine if a preference has been set previously? The thing is, the getInt makes me set a default, so I can't check (for example) that uiLang==null to determine if a preference was set before or not.</p>
  
  <pre><code>SharedPreferences settings = getPreferences(MODE_PRIVATE);
  //If uiLang has not been set before, then lets use the locale.
  uiLang = settings.getInt("uiLang", 1);  //English (=1) es default
  myUI = new UIText(uiLang);
  myTextView.setText(myUI.title);
  </code></pre>