From: Damyan Ivanov Date: Sat, 22 Dec 2018 08:12:09 +0000 (+0000) Subject: MLDB: always use the application context X-Git-Tag: v0.3~165 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=e08f8e03661c9780e4a8f291fd04cab2448de19d;p=mobile-ledger.git MLDB: always use the application context kind of global singleton thing --- diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java b/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java index 1073a88f..4f627779 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java @@ -53,10 +53,10 @@ public final class MLDB { } } public static SQLiteDatabase getReadableDatabase(Context context) { - return getDatabase(context, READ); + return getDatabase(context.getApplicationContext(), READ); } public static SQLiteDatabase getWritableDatabase(Context context) { - return getDatabase(context, WRITE); + return getDatabase(context.getApplicationContext(), WRITE); } static public int get_option_value(Context context, String name, int default_value) { String s = get_option_value(context, name, String.valueOf(default_value));