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

View should load it's content after reusing retained fragment after screen is back on #323

Open
mseroczynski opened this issue Nov 27, 2018 · 1 comment

Comments

@mseroczynski
Copy link
Contributor

mseroczynski commented Nov 27, 2018

Mosby Version: 3.1.1-SNAPSHOT (just upgraded from 3.0.4)

Expected behavior View should load it's content after reusing retained fragment

Actual behavior (include a stacktrace if crash) It does not

Hello :). I'm not sure if this is a bug report or a question. When i build and install my apk while devices screen is off, since 3.1.0 my retained fragment creates it's viewState, calls presenter.loadData BUT it is detached before view.setData/showContent is called. Then, when i turn screen on I'm stuck on loading state so I'd expect it to reload data but applyViewState == true, applyViewStateFromMemory == true so when onViewStateInstanceRestored is called with instanceStateRetainedInMemory == true, nothing happens. Is this a bug? If you could confirm it I can start working on solution, but I'm not sure if I understand problem correctly. Thanks!!

@Override public void onViewStateInstanceRestored(boolean instanceStateRetainedInMemory) { if (!instanceStateRetainedInMemory && viewState.isLoadingState()) { loadData(viewState.isPullToRefreshLoadingState()); } }

Edit: I've just tried to use QueueingPresenter but after long migration it seems like it changes my apps behavior (ViewPagers losing index after rotation etc.). Currently as a hotfix I need to fork 3.0.4 to repair BackStackAccessor but maybe you could suggest me a better solution..? I'd be really grateful.

Edit2: I've successfully recreated all needed functionality and will stick to QueuingPresenter for now.

@sockeqwe
Copy link
Owner

sockeqwe commented Dec 3, 2018

Hello,
I'm sorry to hear that you have problems with this library. I'm not sure if I have understood the problem properly. Is there a way to easily reproduce this or do you have a small example that I could use to debug already in place?

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

No branches or pull requests

2 participants