private static final Pattern transactionDescriptionPattern =
Pattern.compile("<tr class=\"posting\" title=\"(\\S+)\\s(.+)");
private static final Pattern transactionDetailsPattern =
- Pattern.compile("^\\s+" + "(\\S[\\S\\s]+\\S)\\s\\s+([-+]?\\d[\\d,.]*)");
+ Pattern.compile("^\\s+" + "(\\S[\\S\\s]+\\S)\\s\\s+([-+]?\\d[\\d,.]*)(?:\\s+(\\S+)$)?");
private static final Pattern endPattern = Pattern.compile("\\bid=\"addmodal\"");
protected WeakReference<TransactionListActivity> contextRef;
protected int error;
if (context == null) return;
context.onRetrieveDone(success);
}
+ @Override
+ protected void onCancelled() {
+ super.onCancelled();
+ TransactionListActivity context = getContext();
+ if (context == null) return;
+ context.onRetrieveDone(false);
+ }
@SuppressLint("DefaultLocale")
@Override
protected Void doInBackground(Params... params) {
if (m.find()) {
String acc_name = m.group(1);
String amount = m.group(2);
+ String currency = m.group(3);
amount = amount.replace(',', '.');
transaction.addAccount(
new LedgerTransactionAccount(acc_name,
- Float.valueOf(amount)));
+ Float.valueOf(amount), currency));
L(String.format("%s = %s", acc_name, amount));
}
else throw new IllegalStateException(