public void refreshData(DialogInterface dialog) {
    txtSectionSelection.setText(
        mLanguageManager.getSelectedSection() + ": " + Prefs.getKey(Prefs.SECTION_NAME));

    WaiterPadApplication.LOG.debug("menu obtained .. ");
    dialog.dismiss();
    Intent intent = new Intent(SettingsActivity.this, TableListActivity.class);
    startActivity(intent);
    // activity out animation
    Global.activityFinishAnimationLeftToRight(SettingsActivity.this);
    finish();
  }
  @Override
  public void onBackPressed() {
    // unregisterReceiver(SettingsFragment.this);
    if (isSectionSelectionChanged != true) {
      if (mFrom != null && mFrom.equalsIgnoreCase(Global.FROM_HOME_ACTIVITY)) {
        finish();
        Intent intent = new Intent(SettingsActivity.this, MyOrderActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        startActivity(intent);
        // activity out animation
        Global.activityFinishAnimationLeftToRight(SettingsActivity.this);
      } else if (mFrom != null && mFrom.equalsIgnoreCase(Global.FROM_TABLE_LIST)) {

        if (sectionId != null && sectionId.trim().length() > 0) {
          Prefs.addKey(SettingsActivity.this, Prefs.SECTION_ID, sectionId);
          Prefs.addKey(SettingsActivity.this, Prefs.SECTION_NAME, sectionName);
        }

        Intent intent = new Intent(SettingsActivity.this, TableListActivity.class);
        startActivity(intent);

        // activity out animation
        Global.activityFinishAnimationLeftToRight(SettingsActivity.this);
        finish();
      } else if (mFrom != null && mFrom.equalsIgnoreCase(Global.FROM_ORDER_RELATED)) {
        Intent intent = new Intent(SettingsActivity.this, OrderRelatedActivity.class);
        intent.putExtra(Global.TIME_STAMP, mTimestamp);

        if (previousValue != null && previousValue.trim().length() > 0) {
          intent.putExtra(Global.FROM_ACTIVITY, previousValue);
        } else {
          intent.putExtra(Global.FROM_ACTIVITY, Global.FROM_TABLE_LIST);
        }
        startActivity(intent);

        // activity out animation
        Global.activityFinishAnimationLeftToRight(SettingsActivity.this);
        finish();
      } else if (mFrom != null && mFrom.equalsIgnoreCase(Global.FROM_TABLE_ORDER_LIST)) {
        if (previousValue != null) {
          if (previousValue.equalsIgnoreCase(Global.FROM_TABLE_LIST)) {
            Intent intent = new Intent(SettingsActivity.this, TableOrderListActivity.class);
            intent.putExtra(Global.TABLE_ID, mTableId);
            intent.putExtra(Global.TABLE_NUMBER, mTableNumber);
            intent.putExtra(Global.FROM_ACTIVITY, previousValue);
            startActivity(intent);

            // activity out animation
            Global.activityFinishAnimationLeftToRight(SettingsActivity.this);
            finish();
          }
        } else {
          Intent intent = new Intent(SettingsActivity.this, TableOrderListActivity.class);
          intent.putExtra(Global.TABLE_ID, mTableId);
          intent.putExtra(Global.TABLE_NUMBER, mTableNumber);
          intent.putExtra(Global.FROM_ACTIVITY, Global.FROM_TABLE_LIST);
          startActivity(intent);

          // activity out animation
          Global.activityFinishAnimationLeftToRight(SettingsActivity.this);
          finish();
        }
      } else if (mFrom == null) {
        // activity out animation
        finish();
        Global.activityFinishAnimationLeftToRight(SettingsActivity.this);
        super.onBackPressed();
      }
    } else {
      // section has been changed
      Intent intent = new Intent(SettingsActivity.this, TableListActivity.class);
      startActivity(intent);
      // activity out animation
      Global.activityFinishAnimationLeftToRight(SettingsActivity.this);
      finish();
    }
  }