本文整理了Java中android.app.Instrumentation.finish()
方法的一些代码示例,展示了Instrumentation.finish()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instrumentation.finish()
方法的具体详情如下:
包路径:android.app.Instrumentation
类名称:Instrumentation
方法名:finish
暂无
代码示例来源:origin: android-hacker/VirtualXposed
@Override
public void finish(int resultCode, Bundle results) {
base.finish(resultCode, results);
}
代码示例来源:origin: darkskygit/VirtualApp
@Override
public void finish(int resultCode, Bundle results) {
base.finish(resultCode, results);
}
代码示例来源:origin: bzsome/VirtualApp-x326
@Override
public void finish(int resultCode, Bundle results) {
base.finish(resultCode, results);
}
代码示例来源:origin: luili16/UIMocker
@Override
@CallSuper
public void finish(int resultCode, Bundle results) {
if (DEBUG) {
Logger.d(TAG,"finish");
}
mInstrumentation.finish(resultCode, results);
}
代码示例来源:origin: Eaway/AppCrawler
public static boolean launchApp(String targetPackage) {
FileLog.i(TAG_MAIN, "{Launch} " + targetPackage);
UiDevice device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
String launcherPackage = device.getLauncherPackageName();
if (launcherPackage.compareToIgnoreCase(targetPackage) == 0) {
launchHome();
return true;
}
Context context = InstrumentationRegistry.getContext();
final Intent intent = context.getPackageManager().getLaunchIntentForPackage(targetPackage);
if (intent != null) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); // Make sure each launch is a new task
context.startActivity(intent);
device.wait(Until.hasObject(By.pkg(Config.sTargetPackage).depth(0)), Config.sLaunchTimeout);
} else {
String err = String.format("(%s) No launchable Activity.\n", targetPackage);
Log.e(TAG, err);
Bundle bundle = new Bundle();
bundle.putString("ERROR", err);
InstrumentationRegistry.getInstrumentation().finish(1, bundle);
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!