message: Added defensive activity check
diff: @@ -96,11 +96,13 @@ public class NavigationStackView extends ViewGroup implements LifecycleEventList
  }
  void removeFragment() {
  + if (mainActivity != null) {
  FragmentManager fragmentManager = ((FragmentActivity) mainActivity).getSupportFragmentManager();
  FragmentTransaction fragmentTransation = fragmentManager.beginTransaction();
  fragmentTransation.remove(fragment);
  fragmentTransation.commitAllowingStateLoss();
  }
  + }
  @Override
  protected void onLayout(boolean changed, int l, int t, int r, int b) {
  