소스 검색

Clear intent extras in onPause (#770)

this prevents linking module from handling intents each time app is returned to foreground
Guy Carmeli 8 년 전
부모
커밋
02a432dba4
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3
    0
      android/app/src/main/java/com/reactnativenavigation/controllers/IntentDataHandler.java

+ 3
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/IntentDataHandler.java 파일 보기

@@ -1,6 +1,7 @@
1 1
 package com.reactnativenavigation.controllers;
2 2
 
3 3
 import android.content.Intent;
4
+import android.os.Bundle;
4 5
 import android.support.annotation.Nullable;
5 6
 
6 7
 import com.reactnativenavigation.NavigationApplication;
@@ -36,6 +37,8 @@ class IntentDataHandler {
36 37
     static void onPause(@Nullable Intent intent) {
37 38
         if (intent != null) {
38 39
             intent.setData(null);
40
+            intent.getExtras().clear();
41
+            intent.replaceExtras(Bundle.EMPTY);
39 42
         }
40 43
         clear();
41 44
     }