Prevent crash

pull/157/head
M66B 6 years ago
parent fee604659f
commit b3c925944d

@ -1054,7 +1054,7 @@ public class FragmentAccount extends FragmentBase {
fragment.setArguments(aargs);
fragment.setTargetFragment(FragmentAccount.this, REQUEST_SAVE);
fragment.show(getFragmentManager(), "account:save");
} else
} else if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getFragmentManager().popBackStack();
}
@ -1346,7 +1346,8 @@ public class FragmentAccount extends FragmentBase {
@Override
protected void onExecuted(Bundle args, Void data) {
getFragmentManager().popBackStack();
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getFragmentManager().popBackStack();
}
@Override

@ -42,6 +42,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager;
import com.google.android.material.snackbar.Snackbar;
@ -258,7 +259,7 @@ public class FragmentFolder extends FragmentBase {
}
});
onSave(false);
} else
} else if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getFragmentManager().popBackStack();
break;
@ -508,7 +509,7 @@ public class FragmentFolder extends FragmentBase {
ask.setArguments(aargs);
ask.setTargetFragment(FragmentFolder.this, REQUEST_SAVE_CHANGES);
ask.show(getFragmentManager(), "folder:save");
} else
} else if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getFragmentManager().popBackStack();
}
@ -549,7 +550,8 @@ public class FragmentFolder extends FragmentBase {
@Override
protected void onExecuted(Bundle args, Void data) {
getFragmentManager().popBackStack();
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getFragmentManager().popBackStack();
}
@Override

@ -58,6 +58,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.Lifecycle;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputLayout;
@ -770,7 +771,7 @@ public class FragmentIdentity extends FragmentBase {
fragment.setArguments(aargs);
fragment.setTargetFragment(FragmentIdentity.this, REQUEST_SAVE);
fragment.show(getFragmentManager(), "identity:save");
} else
} else if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getFragmentManager().popBackStack();
}
@ -1037,7 +1038,7 @@ public class FragmentIdentity extends FragmentBase {
}
});
onSave(false);
} else
} else if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getFragmentManager().popBackStack();
break;
case REQUEST_DELETE:
@ -1085,7 +1086,8 @@ public class FragmentIdentity extends FragmentBase {
@Override
protected void onExecuted(Bundle args, Void data) {
getFragmentManager().popBackStack();
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getFragmentManager().popBackStack();
}
@Override

Loading…
Cancel
Save