Browse Source

Clear intent extras in onPause (#770)

this prevents linking module from handling intents each time app is returned to foreground
Guy Carmeli 8 years ago
parent
commit
02a432dba4

+ 3
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/IntentDataHandler.java View File

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