react-native-navigation的迁移库

RootActivity.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. super.handleOnCreate();
  16. // Trigger react context initialization, global javascript code will now execute
  17. getReactInstanceManager().createReactContextInBackground();
  18. }
  19. @Override
  20. protected void onPause() {
  21. super.onPause();
  22. finish();
  23. }
  24. // No need to implement stack interface since this activity is only used to start other
  25. // activities such as TabActivity or SingleScreenActivity.
  26. @Override
  27. public Screen getCurrentScreen() {
  28. return null;
  29. }
  30. @Override
  31. public String getCurrentNavigatorId() {
  32. return null;
  33. }
  34. @Override
  35. public int getScreenStackSize() {
  36. return 0;
  37. }
  38. }