@Override public Activity newActivity(Class<?> clazz, Context context, IBinder token, Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance) throws InstantiationException, IllegalAccessException { try { return super.newActivity(clazz, context, token, application, intent, info, title, parent, id, lastNonConfigurationInstance); } catch (Throwable e) { VLog.e(TAG, "activity crashed when call newActivity, clearing", e); // 1. tell ui that we launched(failed) callUiCallback(intent, false); // 3. rethrow throw e; } }
@Override public Activity newActivity(ClassLoader cl, String className, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException { try { return super.newActivity(cl, className, intent); } catch (Throwable e) { VLog.e(TAG, "activity crashed when call newActivity, clearing", e); // 1. tell ui that we launched(failed) callUiCallback(intent, false); // 3. rethrow throw e; } }
@Override public void callActivityOnResume(Activity activity) { VirtualCore.get().getComponentDelegate().beforeActivityResume(activity); VActivityManager.get().onActivityResumed(activity); super.callActivityOnResume(activity); VirtualCore.get().getComponentDelegate().afterActivityResume(activity); Intent intent = activity.getIntent(); callUiCallback(intent, true); }
callUiCallback(intent, false);
@Override public Activity newActivity(ClassLoader cl, String className, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException { try { return super.newActivity(cl, className, intent); } catch (Throwable e) { VLog.e(TAG, "activity crashed when call newActivity, clearing", e); // 1. tell ui that we launched(failed) callUiCallback(intent, false); // 3. rethrow throw e; } }
@Override public Activity newActivity(Class<?> clazz, Context context, IBinder token, Application application, Intent intent, ActivityInfo info, CharSequence title, Activity parent, String id, Object lastNonConfigurationInstance) throws InstantiationException, IllegalAccessException { try { return super.newActivity(clazz, context, token, application, intent, info, title, parent, id, lastNonConfigurationInstance); } catch (Throwable e) { VLog.e(TAG, "activity crashed when call newActivity, clearing", e); // 1. tell ui that we launched(failed) callUiCallback(intent, false); // 3. rethrow throw e; } }
@Override public void callActivityOnResume(Activity activity) { VirtualCore.get().getComponentDelegate().beforeActivityResume(activity); VActivityManager.get().onActivityResumed(activity); super.callActivityOnResume(activity); VirtualCore.get().getComponentDelegate().afterActivityResume(activity); Intent intent = activity.getIntent(); callUiCallback(intent, true); }
callUiCallback(intent, false);