frogermcs/GithubClient

Fails on Android process restart

mplzgta opened this issue · 0 comments

I really love your app as a model for DI for my own! Here's one design problem:

Sometimes Android kills an app process in the background because of low memory. It restarts it automatically when it come back.
(This is different from killing and restarting activities: for a good review see here http://stackoverflow.com/questions/14375720/android-destroying-activities-killing-processes)

Your app crashes under such conditions, if you are not on the startup activity, since the user component is not recreated. The reason is that Android when restarting the app, Android recreates the app object, then the topmost activity (not the earlier ones, until they come into view).

You can verify in your own app by turning on the Developer Option...Background process limit to zero, then drilling down into a user, then switching away from your app and back. The app crashes.

It would be cool to see how you would modify your app and your design pattern to deal with this.