fixed NPE on message recieve if app is not active

This commit is contained in:
Mike Schwörer 2018-11-16 23:28:48 +01:00
parent 53cb259ec1
commit b42204c87d
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -19,7 +19,7 @@ import androidx.lifecycle.ProcessLifecycleOwner;
public class SCNApp extends Application implements LifecycleObserver
{
private static SCNApp instance;
private static WeakReference<MainActivity> mainActivity;
private static WeakReference<MainActivity> 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
*/