- debug("descr", params.toString());
- try (Cursor c2 = App.getDatabase().rawQuery(broaderSql, new String[]{description})) {
- if (!c2.moveToNext()) return;
-
- profileUUID = c2.getString(0);
- transactionId = c2.getInt(1);
- }
- }
- else {
- profileUUID = c.getString(0);
- transactionId = c.getInt(1);
+ debug("descr", description);
+
+ activity.runOnUiThread(() -> {
+ Snackbar.make(recyclerView, R.string.ignoring_preferred_account,
+ Snackbar.LENGTH_LONG)
+ .show();
+ });
+
+ MLDB.queryInBackground(broaderSql, new String[]{description},
+ new MLDB.CallbackHelper() {
+ @Override
+ public void onStart() {
+ model.incrementBusyCounter();
+ }
+ @Override
+ public boolean onRow(@NonNull Cursor cursor) {
+ final String profileUUID = cursor.getString(0);
+ final int transactionId = cursor.getInt(1);
+ activity.runOnUiThread(
+ () -> loadTransactionIntoModel(profileUUID, transactionId));
+ return false;
+ }
+ @Override
+ public void onDone() {
+ model.decrementBusyCounter();
+ }
+ });