mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 21:33:12 +08:00 
			
		
		
		
	use reflect
This commit is contained in:
		| @@ -144,8 +144,21 @@ public class UpdateModuleImpl { | |||||||
|                         return; |                         return; | ||||||
|                     } |                     } | ||||||
|                     try { |                     try { | ||||||
|                         final ReactDelegate reactDelegate = ((ReactActivity) currentActivity).getReactDelegate(); |                         // Try to get getReactDelegate method using reflection | ||||||
|                         reactDelegate.reload(); |                         java.lang.reflect.Method getReactDelegateMethod =  | ||||||
|  |                             ReactActivity.class.getMethod("getReactDelegate"); | ||||||
|  |                         if (getReactDelegateMethod != null) { | ||||||
|  |                             ReactDelegate reactDelegate = (ReactDelegate)  | ||||||
|  |                                 getReactDelegateMethod.invoke(currentActivity); | ||||||
|  |                             reactDelegate.reload(); | ||||||
|  |                         } else { | ||||||
|  |                             currentActivity.runOnUiThread(new Runnable() { | ||||||
|  |                                 @Override | ||||||
|  |                                 public void run() { | ||||||
|  |                                     currentActivity.recreate(); | ||||||
|  |                                 } | ||||||
|  |                             }); | ||||||
|  |                         } | ||||||
|                     } catch (Throwable e) { |                     } catch (Throwable e) { | ||||||
|                         currentActivity.runOnUiThread(new Runnable() { |                         currentActivity.runOnUiThread(new Runnable() { | ||||||
|                             @Override |                             @Override | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 sunny.luo
					sunny.luo