diff --git a/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java b/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java index ab7c4eda10..da8b2934b1 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java +++ b/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java @@ -148,10 +148,10 @@ public class ApplicationContext extends Application implements DefaultLifecycleO @Override public void onCreate() { + DatabaseModule.init(this); super.onCreate(); Log.i(TAG, "onCreate()"); startKovenant(); - DatabaseModule.init(this); initializeSecurityProvider(); initializeLogging(); initializeCrashHandling(); diff --git a/app/src/main/java/org/thoughtcrime/securesms/ShareActivity.java b/app/src/main/java/org/thoughtcrime/securesms/ShareActivity.java index ed0ce4a37c..f03840c1ab 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ShareActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/ShareActivity.java @@ -44,6 +44,7 @@ import org.thoughtcrime.securesms.components.SearchToolbar; import org.thoughtcrime.securesms.contacts.ContactSelectionListFragment; import org.thoughtcrime.securesms.contacts.ContactSelectionListLoader.DisplayMode; import org.thoughtcrime.securesms.conversation.v2.ConversationActivityV2; +import org.thoughtcrime.securesms.dependencies.DatabaseComponent; import org.thoughtcrime.securesms.mms.PartAuthority; import org.thoughtcrime.securesms.providers.BlobProvider; import org.thoughtcrime.securesms.util.MediaUtil; @@ -249,7 +250,7 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity @Override public void onContactSelected(String number) { Recipient recipient = Recipient.from(this, Address.fromExternal(this, number), true); - long existingThread = ApplicationContext.getInstance(this).getDatabaseComponent().threadDatabase().getThreadIdIfExistsFor(recipient); + long existingThread = DatabaseComponent.get(this).threadDatabase().getThreadIdIfExistsFor(recipient); createConversation(existingThread, recipient.getAddress(), DistributionTypes.DEFAULT); }