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;
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();
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;
}