X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;ds=sidebyside;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2FApp.java;h=f0f7c013230f92913d82e6978e1da715f0420bee;hb=4f8b4f8bf16aaef182e1aac31a34f88a2adf5fa8;hp=68f1b9c43c1e14f6f999c9edbfcf832839d539ce;hpb=bc308eb5e470d3f51e91bebad2f368d618593907;p=mobile-ledger-staging.git diff --git a/app/src/main/java/net/ktnx/mobileledger/App.java b/app/src/main/java/net/ktnx/mobileledger/App.java index 68f1b9c4..f0f7c013 100644 --- a/app/src/main/java/net/ktnx/mobileledger/App.java +++ b/app/src/main/java/net/ktnx/mobileledger/App.java @@ -29,6 +29,8 @@ import net.ktnx.mobileledger.utils.Globals; import net.ktnx.mobileledger.utils.Logger; import net.ktnx.mobileledger.utils.MobileLedgerDatabase; +import org.jetbrains.annotations.NotNull; + import java.net.Authenticator; import java.net.MalformedURLException; import java.net.PasswordAuthentication; @@ -53,8 +55,8 @@ public class App extends Application { Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { - MobileLedgerProfile p = Data.profile.getValue(); - if ((p != null) && p.isAuthEnabled()) { + MobileLedgerProfile p = Data.getProfile(); + if (p.isAuthEnabled()) { try { final URL url = new URL(p.getUrl()); final String requestingHost = getRequestingHost(); @@ -93,17 +95,17 @@ public class App extends Application { super.onTerminate(); } @Override - public void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(@NotNull Configuration newConfig) { super.onConfigurationChanged(newConfig); prepareMonthNames(true); Data.refreshCurrencyData(Locale.getDefault()); Data.locale.setValue(Locale.getDefault()); } public SQLiteDatabase getDB() { - if (dbHelper == null) initDb(); + if (dbHelper == null) + initDb(); final SQLiteDatabase db = dbHelper.getWritableDatabase(); - db.execSQL("pragma case_sensitive_like=ON;"); return db; }