From 29e77ed0e06198ee9e51eefdbc545cc2e751a72c Mon Sep 17 00:00:00 2001 From: Ivan Alexandrov Date: Wed, 18 Oct 2023 11:24:15 +0300 Subject: [PATCH] Android 14 support --- .../reactnativenavigation/react/JsDevReloadHandler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/react/JsDevReloadHandler.java b/lib/android/app/src/main/java/com/reactnativenavigation/react/JsDevReloadHandler.java index 412b42faf45..c562ccd5511 100644 --- a/lib/android/app/src/main/java/com/reactnativenavigation/react/JsDevReloadHandler.java +++ b/lib/android/app/src/main/java/com/reactnativenavigation/react/JsDevReloadHandler.java @@ -7,6 +7,7 @@ import android.content.IntentFilter; import android.view.KeyEvent; import android.widget.EditText; +import android.os.Build; import com.facebook.react.devsupport.interfaces.DevSupportManager; import com.reactnativenavigation.utils.UiUtils; @@ -49,7 +50,11 @@ public void removeReloadListener(ReloadListener listener) { } public void onActivityResumed(Activity activity) { - activity.registerReceiver(reloadReceiver, new IntentFilter(RELOAD_BROADCAST)); + if (Build.VERSION.SDK_INT >= 34 && activity.getApplicationInfo().targetSdkVersion >= 34) { + activity.registerReceiver(reloadReceiver, new IntentFilter(RELOAD_BROADCAST), Context.RECEIVER_EXPORTED); + } else { + activity.registerReceiver(reloadReceiver, new IntentFilter(RELOAD_BROADCAST)); + } } public void onActivityPaused(Activity activity) {