how to restart downloading existing logs post an app crash / restart?

Currently when I configure meta detector trackers for logging I save the route ids of each sensor configured and use them to set up the route handler on next connect just like below. 

 RouteManager route = mwBoard.getRouteManager(sharedPreferences.getInt(mwBoard.getMacAddress() + "_log_id", 0));
 route.setLogMessageHandler("log_stream", loggingMessageHandler);

I am able to reconnect and download logs at regular intervals as long as my app does not crash. If I restart downloading logs post an application crash and try to use the saved id it leads to a null pointer exception. Whats the right way to recover and start downloading existing logs at regular intervals post an app crash?


Comments

This discussion has been closed.