public void updateStateFrom(CoinURI coinUri) throws CoinURIParseException {
    // No-op if the view is not created
    if (getView() == null) return;

    setUri(coinUri);

    // delay these actions until fragment is resumed
    handler.post(
        new Runnable() {
          @Override
          public void run() {
            if (sendAmount != null) {
              amountCalculatorLink.setPrimaryAmount(sendAmount);
            }
            updateView();
            validateEverything();
            requestFocusFirst();
          }
        });
  }
  private void processUri(String uri) throws CoinURIParseException {
    CoinURI coinUri = new CoinURI(uri);
    CoinType scannedType = coinUri.getType();

    if (!Constants.SUPPORTED_COINS.contains(scannedType)) {
      String error = getResources().getString(R.string.unsupported_coin, scannedType.getName());
      throw new CoinURIParseException(error);
    }

    setUri(coinUri);

    if (pocket == null) {
      List<WalletAccount> allAccounts = application.getAllAccounts();
      List<WalletAccount> sendFromAccounts = application.getAccounts(coinUri.getType());
      if (sendFromAccounts.size() == 1) {
        pocket = sendFromAccounts.get(0);
      } else if (allAccounts.size() == 1) {
        pocket = allAccounts.get(0);
      } else {
        throw new CoinURIParseException("No default account found");
      }
    }
  }