Example #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.setVolumeControlStream(AudioManager.STREAM_MUSIC);

    mDbHelper = new LoginDbAdapter(Login.this);
    mDbHelper.open();

    Bundle extras = getIntent().getExtras();
    if (extras.getSerializable(InternetMenu.LOGIN_KEY) != null) {
      mWaitDialog = new TimeoutProgressDialog(Login.this, "Logging out", TAG, true);

      @SuppressWarnings("unchecked")
      HashMap<String, String> lastSession =
          (HashMap<String, String>) extras.getSerializable(InternetMenu.LOGIN_KEY);
      mReturnSession = lastSession;

      mDbHelper.deleteLogin(InternetMenu.USER_ID_KEY);
      mDbHelper.deleteLogin(InternetMenu.SESSION_TOKEN_KEY);
      HashMap<String, String> sendList = new HashMap<String, String>();
      sendList.put(InternetMenu.USER_ID_KEY, lastSession.get(InternetMenu.USER_ID_KEY));
      sendList.put(InternetMenu.SESSION_TOKEN_KEY, lastSession.get(InternetMenu.SESSION_TOKEN_KEY));
      new ConnectionManager(Login.this, InternetMenu.mLogoutURL, sendList);
    } else {
      showLoggedOutView();
    }
  }
Example #2
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   if (mDbHelper != null) {
     mDbHelper.close();
   }
 }