SimonHalvdansson / Harmonic-HN

Modern Android client for Hacker News

Home Page:https://play.google.com/store/apps/details?id=com.simon.harmonichackernews

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App state is getting reset after it's been in the background for a while

Angelore opened this issue · comments

The issue: after the app has been in the background for a while, even if it was not killed by the system, going back to it takes you to the starting page.
I have a tendency to read a part of the comment thread and then forget about it for a bit. So not only this resets the position in the comments, it sometimes makes finding the story itself hard (if you are using "Top last week" for example, and it's the next week by the time you return to it).

At first I attributed this to android being too aggressive with its battery saving measures, so I disabled them for harmonic, but alas.

I assume this can be solved with saving the current thread and position in the comments to local storage. Unfortunately, I have no experience with android development yet, so if you could point me in the right direction, I'd be grateful (and could take a swing at this).

Thank you for the app!

This issue is due to the app not using any sort of onSaveInstanceState logic, this was also mentioned in #58 so I am closing the issue.

I myself am not too sure of how best to proceed with this. As is written in the other issue, a ViewModel setup would be ideal but might be some work.