Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pause-resume issues / Move detach to onDestroy? #454

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HilaryN
Copy link
Contributor

@HilaryN HilaryN commented Dec 8, 2020

I've been coming across a few niggly pause/resume issues (listed below).

What do you think about moving the getTileProvider().detach() from onPause to onDestroy? I'm worried about memory leaks if I do this? I tried running it with LeakCanary but it didn't show any memory leak after I stopped the app. On the other hand it also didn't show a memory leak when I took the detach out altogether so I'm confused there...

The code would need more work around the onResume / onPause but first I just wanted to ask what you thought about the general principle of moving the detach to onDestroy?

Here are some of the issues:

  • Location Editor: map is lost when resuming after pausing, e.g. if permission request box comes up or if you go to the Home screen

  • If in Itinerary or Blog when pausing, screen goes to journey planner (or most recent ?resumable? fragment) when resuming, rather than back to Itinerary or Blog.

  • If Find a Place marker is showing when pausing, it would disappear when resuming except that I have put in a workaround to store it. This means is stays there even if app destroyed – not so good. I could refine the workaround further but I'd prefer to improve the pause/resume and get rid of this workaround.

  • If POI bubble is displayed on journey planner, the bubble disappears when resuming. It also disappears if you go to another screen (e.g. Itinerary) and back.

(I think waymarkers are stored so that they remain if app paused or destroyed. I think that's good to keep them even when app destroyed.)

  • When an item is selected from the Navigation Drawer (top left menu), a new instance of the fragment is created, meaning again that current state is lost (e.g. going from journey planner to Itinerary and back will mean that POI bubble disappears).

  • If the permission request box comes up this also pauses the app. I would like the app to continue straight to the requested action if permission is granted but this is made more difficult by the fact that the fragment is destroyed and re-created when the app resumes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants