Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

Lifecycle issue on Many Activity with Fragments Design #364

Closed
KingWu opened this issue Sep 23, 2014 · 1 comment
Closed

Lifecycle issue on Many Activity with Fragments Design #364

KingWu opened this issue Sep 23, 2014 · 1 comment

Comments

@KingWu
Copy link

KingWu commented Sep 23, 2014

hi, i face an issue on life cycle. In my case, i have two Activity and Three fragments.
i have a singleton SpiceManager in Application.

Each Fragment onStop function look like:
@OverRide
public void onStop() {
// Please review #96 for the reason of that
// ugly if statement.
if (getBaseActivity().getSpiceManager().isStarted()) {
getBaseActivity().getSpiceManager().shouldStop();
}
super.onStop();
}

The scenario:
Activity A -- open --> Fragment A ---- Open -----> Fragment B ----Start ---> Activity B --- Open ---> Fragment C

In Fragment C, i call restful API in onCreate function. But, sometimes no response.

I found that the main issue is that, when Activity A switch to Activity B.
Fragment C will create first. And then Fragment B will call onStop and stop the SpiceManager. That's why Fragment C cannot get response.

I would like to ask how to use SpiceManager on Many Activity with Fragments Design to avoid this issue.

@stephanenicolas
Copy link
Owner

Hi @KingWu, issue board is not the place to ask for support. Please, use the google discussion group.

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

No branches or pull requests

2 participants