- try (Cursor c = App.getDatabase()
- .rawQuery(sql, params.toArray(new String[]{})))
- {
- String profileUUID;
- int transactionId;
+ Activity activity = (Activity) recyclerView.getContext();
+ // FIXME: handle exceptions?
+ MLDB.queryInBackground(sql, params.toArray(new String[]{}), new MLDB.CallbackHelper() {
+ @Override
+ public void onStart() {
+ model.incrementBusyCounter();
+ }
+ @Override
+ public void onDone() {
+ model.decrementBusyCounter();
+ }
+ @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; // limit 1, by the way
+ }
+ @Override
+ public void onNoRows() {
+ if (Misc.isEmptyOrNull(accFilter))
+ return;