Fixed lifecycle crashes

This commit is contained in:
M66B
2018-08-21 13:13:17 +00:00
parent 0fcaad281d
commit 8b7bc70c9e
5 changed files with 14 additions and 5 deletions

View File

@@ -33,6 +33,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer;
public class FragmentFolder extends FragmentEx {
@@ -148,7 +149,8 @@ public class FragmentFolder extends FragmentEx {
@Override
public void onChanged(@Nullable EntityFolder folder) {
if (folder == null) {
getFragmentManager().popBackStack();
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getFragmentManager().popBackStack();
return;
}