android.app.Instrumentation.newApplication()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(325)

本文整理了Java中android.app.Instrumentation.newApplication()方法的一些代码示例,展示了Instrumentation.newApplication()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instrumentation.newApplication()方法的具体详情如下:
包路径:android.app.Instrumentation
类名称:Instrumentation
方法名:newApplication

Instrumentation.newApplication介绍

暂无

代码示例

代码示例来源:origin: android-hacker/VirtualXposed

@Override
public Application newApplication(ClassLoader cl, String className, Context context)
    throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  return base.newApplication(cl, className, context);
}

代码示例来源:origin: android-hacker/VirtualXposed

public static Application newApplication(Class<?> clazz, Context context)
    throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  return Instrumentation.newApplication(clazz, context);
}

代码示例来源:origin: greenrobot/greenDAO

/** Returns a prepared application with the onCreate method already called. */
public <T extends Application> T createApplication(Class<T> appClass) {
  assertNull("Application already created", application);
  T app;
  try {
    app = (T) Instrumentation.newApplication(appClass, getContext());
  } catch (Exception e) {
    throw new RuntimeException("Could not create application " + appClass, e);
  }
  app.onCreate();
  application = app;
  return app;
}

代码示例来源:origin: limpoxe/Android-Plugin-Framework

@Override
public Application newApplication(ClassLoader cl, String className, Context context)
    throws InstantiationException, IllegalAccessException,
    ClassNotFoundException {
  if (ProcessUtil.isPluginProcess()) {
    PluginDescriptor pluginDescriptor = PluginManagerHelper.getPluginDescriptorByClassName(className);
    if (pluginDescriptor != null) {
      return instance().getRunningPlugin(pluginDescriptor.getPackageName()).pluginApplication;
    }
  }
  return real.newApplication(cl, className, context);
}

代码示例来源:origin: darkskygit/VirtualApp

@Override
public Application newApplication(ClassLoader cl, String className, Context context)
    throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  return base.newApplication(cl, className, context);
}

代码示例来源:origin: bzsome/VirtualApp-x326

@Override
public Application newApplication(ClassLoader cl, String className, Context context)
    throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  return base.newApplication(cl, className, context);
}

代码示例来源:origin: bzsome/VirtualApp-x326

public static Application newApplication(Class<?> clazz, Context context)
    throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  return Instrumentation.newApplication(clazz, context);
}

代码示例来源:origin: limpoxe/Android-Plugin-Framework

pluginApplication = Instrumentation.newApplication(classLoader.loadClass(pluginDescriptor.getApplicationName()),
    pluginContext);

代码示例来源:origin: darkskygit/VirtualApp

public static Application newApplication(Class<?> clazz, Context context)
    throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  return Instrumentation.newApplication(clazz, context);
}

代码示例来源:origin: luili16/UIMocker

@CallSuper
static public Application newApplication(Class<?> clazz, Context context)
    throws InstantiationException, IllegalAccessException,
    ClassNotFoundException {
  if (DEBUG) {
    Logger.d(TAG,"newApplication(Class<?> clazz, Context context)");
  }
  return Instrumentation.newApplication(clazz, context);
}

代码示例来源:origin: org.greenrobot/greendao

/** Returns a prepared application with the onCreate method already called. */
public <T extends Application> T createApplication(Class<T> appClass) {
  assertNull("Application already created", application);
  T app;
  try {
    app = (T) Instrumentation.newApplication(appClass, getContext());
  } catch (Exception e) {
    throw new RuntimeException("Could not create application " + appClass, e);
  }
  app.onCreate();
  application = app;
  return app;
}

代码示例来源:origin: de.greenrobot/greendao

/** Returns a prepared application with the onCreate method already called. */
public <T extends Application> T createApplication(Class<T> appClass) {
  assertNull("Application already created", application);
  T app;
  try {
    app = (T) Instrumentation.newApplication(appClass, getContext());
  } catch (Exception e) {
    throw new RuntimeException("Could not create application " + appClass, e);
  }
  app.onCreate();
  application = app;
  return app;
}

代码示例来源:origin: org.greenrobot/greendao-encryption

/** Returns a prepared application with the onCreate method already called. */
public <T extends Application> T createApplication(Class<T> appClass) {
  assertNull("Application already created", application);
  T app;
  try {
    app = (T) Instrumentation.newApplication(appClass, getContext());
  } catch (Exception e) {
    throw new RuntimeException("Could not create application " + appClass, e);
  }
  app.onCreate();
  application = app;
  return app;
}

代码示例来源:origin: AndrewReitz/android-spock

@Override public void interceptSetupMethod(IMethodInvocation invocation) throws Throwable {
  final Application application =
    Instrumentation.newApplication(applicationClass, instrumentation.getTargetContext());
  fieldInfo.writeValue(invocation.getInstance(), application);
  invocation.proceed();
 }
}

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

@Before
public void setUp() throws IllegalAccessException, ClassNotFoundException, InstantiationException {
  AppCenter.unsetInstance();
  Constants.APPLICATION_DEBUGGABLE = false;
  mApplication = Instrumentation.newApplication(Application.class, InstrumentationRegistry.getTargetContext());
}

代码示例来源:origin: goeasyway/EasyPlug

application = instrumentation.newApplication(classLoader, appClassName, base);
ReflectUtils.writeField(loadedApk, "mApplication", application);
if (base != null) {

代码示例来源:origin: iqiyi/Neptune

try {
  this.mPluginApplication = hostInstr.newApplication(mPluginClassLoader, className, mPluginAppContext);
} catch (Exception e) {
  ErrorUtil.throwErrorIfNeed(e);

相关文章

Instrumentation类方法