File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
android/src/main/java/cn/reactnative/modules/update Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -144,8 +144,21 @@ public void run() {
144144 return ;
145145 }
146146 try {
147- final ReactDelegate reactDelegate = ((ReactActivity ) currentActivity ).getReactDelegate ();
148- reactDelegate .reload ();
147+ // Try to get getReactDelegate method using reflection
148+ java .lang .reflect .Method getReactDelegateMethod =
149+ ReactActivity .class .getMethod ("getReactDelegate" );
150+ if (getReactDelegateMethod != null ) {
151+ ReactDelegate reactDelegate = (ReactDelegate )
152+ getReactDelegateMethod .invoke (currentActivity );
153+ reactDelegate .reload ();
154+ } else {
155+ currentActivity .runOnUiThread (new Runnable () {
156+ @ Override
157+ public void run () {
158+ currentActivity .recreate ();
159+ }
160+ });
161+ }
149162 } catch (Throwable e ) {
150163 currentActivity .runOnUiThread (new Runnable () {
151164 @ Override
You can’t perform that action at this time.
0 commit comments