List of usage examples for android.app Instrumentation getContext
public Context getContext()
From source file:org.onepf.opfiab.opfiab_uitest.tests.ui.UnifiedFragmentHelperTest.java
private static void reopenActivity(Instrumentation instrumentation) throws InterruptedException { final Context context = instrumentation.getContext(); @SuppressWarnings("deprecation") final Intent intent = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)) .getRecentTasks(2, 0).get(1).baseIntent; intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); instrumentation.getContext().startActivity(intent); Thread.sleep(WAIT_REOPEN_ACTIVITY); }