import android.widget.FilterQueryProvider;
import android.widget.SimpleCursorAdapter;
+import net.ktnx.mobileledger.async.DbOpQueue;
import net.ktnx.mobileledger.async.DescriptionSelectedCallback;
import net.ktnx.mobileledger.model.Data;
import net.ktnx.mobileledger.model.MobileLedgerProfile;
}
static public void setOption(String name, String value) {
debug("option", String.format("%s := %s", name, value));
- SQLiteDatabase db = MLDB.getDatabase();
- db.execSQL("insert or replace into options(profile, name, value) values(?, ?, ?);",
+ DbOpQueue.add("insert or replace into options(profile, name, value) values(?, ?, ?);",
new String[]{NO_PROFILE, name, value});
}
static public void setLongOption(String name, long value) {
final AutoCompleteTextView view,
final String table, final String field,
final boolean profileSpecific) {
- hookAutocompletionAdapter(context, view, table, field, profileSpecific, null, null, Data.profile.get());
+ hookAutocompletionAdapter(context, view, table, field, profileSpecific, null, null,
+ Data.profile.getValue());
}
@TargetApi(Build.VERSION_CODES.N)
public static void hookAutocompletionAdapter(final Context context,
}
}
-class MobileLedgerDatabase extends SQLiteOpenHelper implements AutoCloseable {
+class MobileLedgerDatabase extends SQLiteOpenHelper {
private static final String DB_NAME = "MoLe.db";
private static final int LATEST_REVISION = 22;
private static final String CREATE_DB_SQL = "create_db";