Skip to content
Snippets Groups Projects
Verified Commit 78abfa36 authored by Torsten Grote's avatar Torsten Grote
Browse files

Check lifecycle state before changing fragment

parent e47d4159
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ import java.util.List;
import javax.annotation.Nullable;
import javax.inject.Inject;
import static android.arch.lifecycle.Lifecycle.State.STARTED;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
import static android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT;
......@@ -148,6 +149,7 @@ public abstract class BaseActivity extends AppCompatActivity
}
public void showNextFragment(BaseFragment f) {
if (!getLifecycle().getCurrentState().isAtLeast(STARTED)) return;
getSupportFragmentManager().beginTransaction()
.setCustomAnimations(R.anim.step_next_in,
R.anim.step_previous_out, R.anim.step_previous_in,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment