title: android: calling onCreate in class w/o view
body: <p>I'm wondering how I can call an onCreate in a class that has no View in android.
  I'm creating a data-class for sharedpreferences, but sharedpreferences need to be called in the onCreate.
  my Class would look a bit like this:</p>
  
  <pre><code>public class getData extends PreferenceActivity {
  
  String username;
  String password;
  String auth_key;
  String PREF_FILE = "prefs";
  public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
          SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
          //SharedPreferences settings = getSharedPreferences(PREF_FILE, MODE_PRIVATE);
          SharedPreferences.Editor editor = settings.edit();
          username = settings.getString("username",null);
          password = settings.getString("password",null);
          auth_key = settings.getString("auth_key",null);
  }
  
  public String getSHA1(){
      return password;
  }
  public String getUsername(){
      return username;
  }
  public String getAuth_key(){
      return auth_key;
  }
  </code></pre>
  
  <p>any tips are a great help and well appreciated</p>