diff options
author | steckbrief <steckbrief@chefmail.de> | 2015-12-16 21:55:02 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2015-12-16 21:55:02 +0100 |
commit | 4f0061293e1d8e90d2828deeb6b72d8a2c8bd509 (patch) | |
tree | a365b75f1d8cd49639b0e6b597aeb48ea82b1773 /src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java | |
parent | f49b979cbe96a81c7f20f209bec7e5a1c9f3c24f (diff) | |
parent | c26335f3e366110366eb89025a42875bcb7840a9 (diff) |
Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java b/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java index 4a67aa3e..9c217e35 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java +++ b/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java @@ -8,6 +8,8 @@ import android.preference.PreferenceManager; import java.io.File; import de.thedevstack.conversationsplus.utils.ImageUtil; +import eu.siacs.conversations.utils.SerialSingleThreadExecutor; + import eu.siacs.conversations.R; /** @@ -19,6 +21,9 @@ public class ConversationsPlusApplication extends Application { */ private static ConversationsPlusApplication instance; + private final SerialSingleThreadExecutor mFileAddingExecutor = new SerialSingleThreadExecutor(); + private final SerialSingleThreadExecutor mDatabaseExecutor = new SerialSingleThreadExecutor(); + /** * Initializes the application and saves its instance. */ @@ -37,6 +42,14 @@ public class ConversationsPlusApplication extends Application { return ConversationsPlusApplication.instance; } + public static void executeFileAdding(Runnable r) { + getInstance().mFileAddingExecutor.execute(r); + } + + public static void executeDatabaseOperation(Runnable r) { + getInstance().mDatabaseExecutor.execute(r); + } + /** * Returns the application's context. * @return Context the application's context |