react-native-navigation的迁移库

RootActivity.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.reactnativenavigation.activities;
  2. import com.facebook.react.ReactRootView;
  3. import com.reactnativenavigation.core.objects.Screen;
  4. /**
  5. * This activity is used to start the JS execution where we load our actual app/screens (index.android.js)
  6. * Triggering react context initialization execute global code before any {@link ReactRootView}
  7. * are displayed.
  8. * <p>Only your MainActivity or activities with {@code action.MAIN} and {@code category.LAUNCHER}
  9. * should extend this activity.
  10. * Created by guyc on 13/04/16.
  11. */
  12. public class RootActivity extends BaseReactActivity {
  13. @Override
  14. protected void handleOnCreate() {
  15. // Trigger react context initialization, global javascript code will now execute
  16. getReactInstanceManager().createReactContextInBackground();
  17. }
  18. @Override
  19. protected void onPause() {
  20. super.onPause();
  21. finish();
  22. }
  23. // No need to implement stack interface since this activity is only used to start other
  24. // activities such as TabActivity or SingleScreenActivity.
  25. @Override
  26. protected Screen getCurrentScreen() {
  27. return null;
  28. }
  29. @Override
  30. public String getCurrentNavigatorId() {
  31. return null;
  32. }
  33. @Override
  34. public int getScreenStackSize() {
  35. return 0;
  36. }
  37. }