@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Bundle parms = getIntent().getExtras();
    int sessionId = parms.getInt("sess_id");
    profileId = parms.getInt("prof_id");

    if (savedInstanceState != null) {
      sessionId = savedInstanceState.getInt("sess_id");
    }

    if (sessionId == 0) {
      loginFailure();
    } else {
      loadContext(sessionId);
    }
  }
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   if (this.session != null) outState.putInt("sess_id", this.session.ID);
 }