File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
android/src/main/java/cn/reactnative/modules/update Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -150,14 +150,17 @@ public void run() {
150150 if (getReactDelegateMethod != null ) {
151151 ReactDelegate reactDelegate = (ReactDelegate )
152152 getReactDelegateMethod .invoke (currentActivity );
153- reactDelegate .reload ();
153+
154+ // Try to get reload method using reflection
155+ java .lang .reflect .Method reloadMethod =
156+ ReactDelegate .class .getMethod ("reload" );
157+ if (reloadMethod != null ) {
158+ reloadMethod .invoke (reactDelegate );
159+ } else {
160+ throw new NoSuchMethodException ();
161+ }
154162 } else {
155- currentActivity .runOnUiThread (new Runnable () {
156- @ Override
157- public void run () {
158- currentActivity .recreate ();
159- }
160- });
163+ throw new NoSuchMethodException ();
161164 }
162165 } catch (Throwable e ) {
163166 currentActivity .runOnUiThread (new Runnable () {
You can’t perform that action at this time.
0 commit comments