public static void appLogout(
      boolean isUserUpdateConflict, boolean isServerError, boolean isInvalidToken) {

    Activity fromActivity = SideBarActivity.getValidContext();

    Intent goToSignIn = new Intent(fromActivity, SignInActivity.class);

    if (isServerError) {
      goToSignIn.putExtra("password_from_prefs", SpikaApp.getPreferences().getUserPassword());
      goToSignIn.putExtra("email_from_prefs", SpikaApp.getPreferences().getUserEmail());
    }
    if (isInvalidToken) {
      goToSignIn.putExtra("invalid_token", true);
    }

    GCMRegistrar.unregister(SpikaApp.getInstance().getApplicationContext());

    SpikaApp.getPreferences().setWatchingGroupId("");
    SpikaApp.getPreferences().setWatchingGroupRev("");

    if (SideBarActivity.sInstance != null) {
      goToSignIn.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
      SideBarActivity.sInstance.startActivity(goToSignIn);

      sendBroadcastLogout(SideBarActivity.sInstance);
    } else if (SplashScreenActivity.sInstance != null) {
      SplashScreenActivity.sInstance.startActivity(goToSignIn);

      sendBroadcastLogout(SplashScreenActivity.sInstance);
    }
  }
  public void closeSideBar() {

    if (mRlSideBarHolder.getVisibility() == View.VISIBLE) {
      mRlBody.bringToFront();
      mRlSideBarHolder.startAnimation(SpikaApp.getSlideOutLeft());
      mRlBody.startAnimation(SpikaApp.getSlideInRight());
      mRlSideBarHolder.setVisibility(View.INVISIBLE);
      mSideBarOpened = false;
    }

    enableViews();
  }
  public void openSideBar() {

    getActivitySummary();

    mRlSideBarHolder.setVisibility(View.VISIBLE);
    mRlSideBarHolder.bringToFront();
    mRlSideBarHolder.startAnimation(SpikaApp.getSlideInLeft());
    mRlBody.startAnimation(SpikaApp.getSlideOutRight());
    mSideBarOpened = true;

    if (!this.equals(RecentActivityActivity.getInstance())
        && !this.getComponentName().toString().contains("UsersActivity")
        && !this.getComponentName().toString().contains("GroupsActivity")) {
      hideKeyboard();
    }

    disableViews();
  }
  private void Initialization(String title) {

    mRlSideBarHolder = (RelativeLayout) findViewById(R.id.rlSideBarHolder);
    mRlTitle = (RelativeLayout) findViewById(R.id.rlTitle);
    mBtnOpenSideBar = (ImageButton) findViewById(R.id.btnOpenSideBar);
    mTvTitle = (TextView) findViewById(R.id.tvTitle);

    mRlUsers = (RelativeLayout) findViewById(R.id.rlUsers);
    mRlUsers.setOnClickListener(new SideMenuButtonListener(getComponentName(), BUTTON_USERS));

    mRlGroups = (RelativeLayout) findViewById(R.id.rlGroups);
    mRlGroups.setOnClickListener(new SideMenuButtonListener(getComponentName(), BUTTON_GROUPS));

    mRlProfile = (RelativeLayout) findViewById(R.id.rlProfile);
    mRlProfile.setOnClickListener(new SideMenuButtonListener(getComponentName(), BUTTON_PROFILE));

    mRlInformation = (RelativeLayout) findViewById(R.id.rlInformation);
    mRlInformation.setOnClickListener(
        new SideMenuButtonListener(getComponentName(), BUTTON_INFORMATION));

    mRlSettings = (RelativeLayout) findViewById(R.id.rlSettings);
    mRlSettings.setOnClickListener(new SideMenuButtonListener(getComponentName(), BUTTON_SETTINGS));

    mRlLogout = (RelativeLayout) findViewById(R.id.rlLogout);
    mRlLogout.setOnClickListener(new SideMenuButtonListener(getComponentName(), BUTTON_LOGOUT));

    mRlPrivateWall = (RelativeLayout) findViewById(R.id.rlPrivateWall);
    mRlPrivateWall.setOnClickListener(
        new SideMenuButtonListener(getComponentName(), BUTTON_PRIVATE_WALL));

    mRlNotificationsTitle = (RelativeLayout) findViewById(R.id.rlNotifications);
    mRlNotificationsTitle.setOnClickListener(
        new SideMenuButtonListener(getComponentName(), NOTIFICATIONS));

    mIvNotificationsBalloon = (ImageView) findViewById(R.id.ivNotificationsBalloon);
    mTvNotificationsNumber = (TextView) findViewById(R.id.tvNotificationsNumber);

    mRlSideBarHolder.getLayoutParams().width = SpikaApp.getTransport();

    mRlBody = (RelativeLayout) findViewById(R.id.rlBody);

    mSideBarOpened = false;
  }