react-native-navigation的迁移库

IntentDataHandler.java 733B

12345678910111213141516171819202122232425262728293031
  1. package com.reactnativenavigation.controllers;
  2. import android.content.Intent;
  3. import static android.content.Intent.ACTION_VIEW;
  4. public class IntentDataHandler {
  5. private static Intent intent;
  6. static void saveIntentData(Intent intent) {
  7. IntentDataHandler.intent = intent;
  8. }
  9. static boolean hasIntentData() {
  10. return intent != null;
  11. }
  12. static void setIntentData(Intent intent) {
  13. if (IntentDataHandler.intent != null) {
  14. intent.setData(IntentDataHandler.intent.getData());
  15. intent.putExtras(IntentDataHandler.intent);
  16. intent.setAction(ACTION_VIEW);
  17. clear();
  18. }
  19. }
  20. private static void clear() {
  21. intent = null;
  22. }
  23. }