Beispiel #1
0
  @Override
  public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {

    // outState.putSerializable(INSTALLED_WALLET, lastWallet);
    outState.putString(WALLET_PUBLIC_KEY, lastWallet.getWalletPublicKey());
    super.onSaveInstanceState(outState, outPersistentState);
  }
  @Override
  protected void onDestroy() {
    super.onDestroy();

    unbindDrawables(findViewById(R.id.drawer_layout));
    System.gc();
  }
  /**
   * 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();
    }
  }
Beispiel #4
0
  /**
   * This method is called after onStart() when the activity is being re-initialized from a
   * previously saved state, given here in savedInstanceState. Most implementations will simply use
   * onCreate(Bundle) to restore their state, but it is sometimes convenient to do it here after all
   * of the initialization has been done or to allow subclasses to decide whether to use your
   * default implementation
   *
   * @param savedInstanceState
   */
  @Override
  protected void onRestoreInstanceState(Bundle savedInstanceState) {
    try {

      if (savedInstanceState == null) {
        savedInstanceState = new Bundle();
      } else super.onRestoreInstanceState(savedInstanceState);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Beispiel #5
0
  @Override
  public void onRestoreInstanceState(Bundle savedInstanceState, PersistableBundle persistentState) {
    super.onRestoreInstanceState(savedInstanceState, persistentState);
    try {
      String walletPublicKey = savedInstanceState.getString(WALLET_PUBLIC_KEY);

      getWalletRuntimeManager().getWallet(walletPublicKey);

    } catch (WalletRuntimeExceptions walletRuntimeExceptions) {
      walletRuntimeExceptions.printStackTrace();
    }
  }
Beispiel #6
0
  /**
   * Called when the activity is first created
   *
   * @param savedInstanceState
   */
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setActivityType(ActivityType.ACTIVITY_TYPE_WALLET);

    try {

      loadUI(createOrCallWalletSession());

    } catch (Exception e) {
      getErrorManager()
          .reportUnexpectedWalletException(
              Wallets.CWP_WALLET_RUNTIME_WALLET_BITCOIN_WALLET_ALL_BITDUBAI,
              UnexpectedWalletExceptionSeverity.DISABLES_THIS_FRAGMENT,
              FermatException.wrapException(e));
      Toast.makeText(
              getApplicationContext(), "Oooops! recovering from system error", Toast.LENGTH_LONG)
          .show();
    }
  }
Beispiel #7
0
 /** Dispatch onStop() to all fragments. Ensure all loaders are stopped. */
 @Override
 protected void onStop() {
   super.onStop();
 }
Beispiel #8
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
 }
Beispiel #9
0
 @Override
 protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);
 }
Beispiel #10
0
 /**
  * Called to retrieve per-instance state from an activity before being killed so that the state
  * can be restored in onCreate(Bundle) or onRestoreInstanceState(Bundle)
  *
  * @param outState
  */
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
 }
Beispiel #11
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();
    }
  }