Example #1
0
  /**
   * Called when the activity is first created
   *
   * @param savedInstanceState
   */
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    activePlatforms = getIntent().getParcelableArrayListExtra(StartActivity.ACTIVE_PLATFORMS);

    developMode = getIntent().getBooleanExtra(DEVELOP_MODE, false);

    setActivityType(ActivityType.ACTIVITY_TYPE_SUB_APP);

    try {

      loadUI(createOrCallSubAppSession());

    } catch (Exception e) {

      // reportUnexpectedUICoreException
      // hacer un enum con areas genericas
      // TODO error manager null
      //  getErrorManager().reportUnexpectedUIException(UISource.ACTIVITY,
      // UnexpectedUIExceptionSeverity.UNSTABLE, FermatException.wrapException(e));
      Toast.makeText(
              getApplicationContext(), "Oooops! recovering from system error", Toast.LENGTH_LONG)
          .show();
    }
  }
Example #2
0
  @Override
  protected void onDestroy() {
    super.onDestroy();

    unbindDrawables(findViewById(R.id.drawer_layout));
    System.gc();
  }
Example #3
0
  /** This method catch de back bottom event and decide which screen load */
  @Override
  public void onBackPressed() {

    // get actual fragment on execute
    String frgBackType = null;
    try {
      SubAppRuntimeManager subAppRuntimeManager = getSubAppRuntimeMiddleware();

      com.bitdubai.fermat_api.layer.all_definition.navigation_structure.Fragment fragment = null;

      Activity activity = null;
      try {

        activity = subAppRuntimeManager.getLastSubApp().getLastActivity();
        fragment = activity.getLastFragment();

      } catch (NullPointerException nullPointerException) {
        fragment = null;
      }

      // get setting fragment to back
      // if not fragment to back I back to desktop

      if (fragment != null) frgBackType = fragment.getBack();

      if (frgBackType != null) {

        Activity activities = getSubAppRuntimeMiddleware().getLastSubApp().getLastActivity();

        com.bitdubai.fermat_api.layer.all_definition.navigation_structure.Fragment fragmentBack =
            activities.getFragment(frgBackType); // set back fragment to actual fragment to run

        // TODO: ver como hacer para obtener el id del container
        if (fragmentBack.getType().equals("CSADDTD")
            || fragmentBack.getType().equals("CSADDTT")
            || fragmentBack.getType().equals("CSADDTR")
            || fragmentBack.getType().equals("CSADDT")) {
          this.loadFragment(
              subAppRuntimeManager.getLastSubApp().getType(), R.id.logContainer, frgBackType);
        } else {
          this.loadFragment(
              subAppRuntimeManager.getLastSubApp().getType(), R.id.startContainer, frgBackType);
        }

      } else if (activity != null && activity.getBackActivity() != null) {
        changeActivity(activity.getBackActivity().getCode());

      } else {
        // set Desktop current activity
        activity = getSubAppRuntimeMiddleware().getLastSubApp().getLastActivity();
        if (activity.getType() != Activities.CWP_WALLET_MANAGER_MAIN) {
          resetThisActivity();
          // getSubAppRuntimeMiddleware().getHomeScreen();
          getSubAppRuntimeMiddleware().getSubApp(SubApps.CWP_WALLET_MANAGER);
          getSubAppRuntimeMiddleware()
              .getLastSubApp()
              .getActivity(Activities.CWP_WALLET_MANAGER_MAIN);
          // cleanWindows();

          loadUI(createOrCallSubAppSession());
        } else {
          super.onBackPressed();
        }
      }
    } catch (Exception e) {
      getErrorManager()
          .reportUnexpectedUIException(
              UISource.ACTIVITY, UnexpectedUIExceptionSeverity.UNSTABLE, e);
      Toast.makeText(
              getApplicationContext(), "Oooops! recovering from system error", Toast.LENGTH_LONG)
          .show();
    }
  }