Skip to content

Handling app sleep / screen lock / Activity pause #74

Open
@rjhllr

Description

@rjhllr

Good day to all of you,

after searching the repo for certain keywords (sleep, onResume, lock..) I didn't come up with an issue talking about this topic and it's not clear from the doc either.
I've written an app that consumes and manipulates data on a Meteor server. Now this app is expected to be used on-and-off over a period of some hours. This, of course, includes users locking their screen and/or switching to a different app from time to time.

I've done a test where I add a new document to a collection and update an existing one after having locked the screen. When I unlock the screen again, I come back to my activity which remains unchanged. When I then add another document or update one, all documents update accordingly.
From this I deduce that the app does not know about changes that happen when the Activity is paused, which is what I'd expect.

Taking a guess I'd say that I have to implement some sort of "refreshing" in the onResume method of the activity. I have already tried calling disconnect/reconnect there, which does not work (probably because of the login which is needed for each and every method).
I'm sure there must be a better solution though.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions