Anyone else seen weird behaviour with google push notifications? It seems that clicking on push notification while the application is in the background crashes the app. I initially thought that I had some errors on my code but I tested this with the “GooglePushNotifications” sample application with the same results. So, everything works well until I exit the app with device back button. When a notification arrives and I click it after I have exited the app the application crashes instead of opening up. The same does not happen when using home button to exit the app.
I’m running build 2014.2224 and testing with SG4+ (i9506)
Logcat outputs the following exception:
04-01 22:59:38.988: E/AndroidRuntime(31313): FATAL EXCEPTION: main
04-01 22:59:38.988: E/AndroidRuntime(31313): java.lang.RuntimeException: Unable to start receiver com.ansca.corona.notifications.StatusBarBroadcastReceiver: java.lang.NullPointerException
04-01 22:59:38.988: E/AndroidRuntime(31313): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2554)
04-01 22:59:38.988: E/AndroidRuntime(31313): at android.app.ActivityThread.access$1600(ActivityThread.java:168)
04-01 22:59:38.988: E/AndroidRuntime(31313): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
04-01 22:59:38.988: E/AndroidRuntime(31313): at android.os.Handler.dispatchMessage(Handler.java:99)
04-01 22:59:38.988: E/AndroidRuntime(31313): at android.os.Looper.loop(Looper.java:176)
04-01 22:59:38.988: E/AndroidRuntime(31313): at android.app.ActivityThread.main(ActivityThread.java:5493)
04-01 22:59:38.988: E/AndroidRuntime(31313): at java.lang.reflect.Method.invokeNative(Native Method)
04-01 22:59:38.988: E/AndroidRuntime(31313): at java.lang.reflect.Method.invoke(Method.java:525)
04-01 22:59:38.988: E/AndroidRuntime(31313): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
04-01 22:59:38.988: E/AndroidRuntime(31313): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
04-01 22:59:38.988: E/AndroidRuntime(31313): at dalvik.system.NativeStart.main(Native Method)
04-01 22:59:38.988: E/AndroidRuntime(31313): Caused by: java.lang.NullPointerException
04-01 22:59:38.988: E/AndroidRuntime(31313): at com.ansca.corona.notifications.StatusBarBroadcastReceiver.onReceive(StatusBarBroadcastReceiver.java:64)
04-01 22:59:38.988: E/AndroidRuntime(31313): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2538)
04-01 22:59:38.988: E/AndroidRuntime(31313): … 10 more