2019-07-22 13:28:25.939 16239-16433/com.indiewalk.watchdog.earthquake E/AndroidRuntime: FATAL EXCEPTION: IntentService[EarthquakeSyncIntentService]
Process: com.indiewalk.watchdog.earthquake, PID: 16239
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
at com.indiewalk.watchdog.earthquake.net.EarthquakeNetworkDataSource.fetchEarthquakeWrapper(EarthquakeNetworkDataSource.java:147)
at com.indiewalk.watchdog.earthquake.net.EarthquakeSyncIntentService.onHandleIntent(EarthquakeSyncIntentService.java:21)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.os.HandlerThread.run(HandlerThread.java:65)
-> must make a check in connection in initializeData, before arriving to intent that fetchdata, and giving the user a message.
Just like in loader used by refresh in main page for checking connection before doing everything,
and communicating it to main view
2019-07-22 13:28:25.939 16239-16433/com.indiewalk.watchdog.earthquake E/AndroidRuntime: FATAL EXCEPTION: IntentService[EarthquakeSyncIntentService] Process: com.indiewalk.watchdog.earthquake, PID: 16239 java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference at com.indiewalk.watchdog.earthquake.net.EarthquakeNetworkDataSource.fetchEarthquakeWrapper(EarthquakeNetworkDataSource.java:147) at com.indiewalk.watchdog.earthquake.net.EarthquakeSyncIntentService.onHandleIntent(EarthquakeSyncIntentService.java:21) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:176) at android.os.HandlerThread.run(HandlerThread.java:65)
-> must make a check in connection in initializeData, before arriving to intent that fetchdata, and giving the user a message. Just like in loader used by refresh in main page for checking connection before doing everything, and communicating it to main view