Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 5db3c01

Browse files
committed
Merge pull request #331 from Microsoft/reload_fix
Reload fix
2 parents ef077a2 + 8604f5c commit 5db3c01

File tree

1 file changed

+7
-0
lines changed
  • android/app/src/main/java/com/microsoft/codepush/react

1 file changed

+7
-0
lines changed

android/app/src/main/java/com/microsoft/codepush/react/CodePush.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,13 @@ private void loadBundleLegacy() {
403403
private void loadBundle() {
404404
CodePush.this.clearDebugCacheIfNeeded();
405405

406+
// Our preferred reload logic relies on the user's Activity inheriting from the
407+
// core ReactActivity class, so if it doesn't, we fallback early to our legacy behavior.
408+
if (!ReactActivity.class.isInstance(mainActivity)) {
409+
loadBundleLegacy();
410+
return;
411+
}
412+
406413
try {
407414
// #1) Get the private ReactInstanceManager, which is what includes
408415
// the logic to reload the current React context.

0 commit comments

Comments
 (0)