From b42204c87d7528f79c069db15c172f2cb1637446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Fri, 16 Nov 2018 23:28:48 +0100 Subject: [PATCH] fixed NPE on message recieve if app is not active --- .../simplecloudnotifier/SCNApp.java | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java index 1eaf6ef..223060d 100644 --- a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java +++ b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java @@ -19,7 +19,7 @@ import androidx.lifecycle.ProcessLifecycleOwner; public class SCNApp extends Application implements LifecycleObserver { private static SCNApp instance; - private static WeakReference mainActivity; + private static WeakReference mainActivity = new WeakReference<>(null); public static final boolean LOCAL_DEBUG = BuildConfig.DEBUG; public static final boolean DEBUG = BuildConfig.DEBUG || !BuildConfig.VERSION_NAME.endsWith(".0"); @@ -102,33 +102,23 @@ public class SCNApp extends Application implements LifecycleObserver /* ==TODO== -[X] - Pro mode -[X] - no ads -[X] - more quota -[X] - restore pro mode -[X] - send pro state to server - -[X] - prevent duplicate-send -[X] - send custom msg-id in API -[X] - prevent second ack on same msg-id - -[X] - more in-depth API doc on website (?) - -[X] - perhaps response codes in api (?) - -[X] - verify recieve - +[ ] - Delete single message (swipe right) +[ ] - scroll to newest message (armin says it doesnt) [ ] - Android O repeat sound +[ ] - Query non-ack-ed messages in app +[ ] - notifications: how does WA do it??? - there you can change shit in-app +[ ] - periodically get non-ack (option - even when not in-app) +[ ] - fix settings layout wrap [ ] - test notification channels -[ ] - publish (+ HN post ?) +[ ] - publish (+ HN post ?) -[ ] - Use for mscom server errrors -[ ] - Use for bfb server errors -[ ] - Use for transmission state -[ ] - Message on connnection lost (seperate process - resend until succ) -[ ] - Message on connnection regained -[ ] - Message on seed-count changed +[ ] - Use for mscom server errrors +[ ] - Use for bfb server errors +[ ] - Use for transmission state +[ ] - Message on connnection lost (seperate process - resend until succ) +[ ] - Message on connnection regained +[ ] - Message on seed-count changed */ \ No newline at end of file