aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2015-12-16 00:53:04 +0100
committersteckbrief <steckbrief@chefmail.de>2015-12-16 00:53:04 +0100
commitc26335f3e366110366eb89025a42875bcb7840a9 (patch)
treef6ae254a0bf0a8ce2d9e43efd48a5eba6e454b4f /src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
parent556697c47e74766215c17fb5f721d71494a02643 (diff)
Implements FS#19, FS#84; Introduces ImageResizeException, MessageUtil and distinguishes between image resizing and compressing/saving
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java b/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
index a9b09551..e4fabda5 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusApplication.java
@@ -8,6 +8,7 @@ import android.preference.PreferenceManager;
import java.io.File;
import de.thedevstack.conversationsplus.utils.ImageUtil;
+import de.thedevstack.conversationsplus.utils.SerialSingleThreadExecutor;
/**
* This class is used to provide static access to the applicationcontext.
@@ -18,6 +19,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.
*/
@@ -36,6 +40,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