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

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

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

Instrumentation.callActivityOnPause介绍

暂无

代码示例

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

@Override
public void callActivityOnPause(Activity activity) {
  base.callActivityOnPause(activity);
}

代码示例来源:origin: robolectric/robolectric

public ActivityController<T> pause() {
 shadowMainLooper.runPaused(() -> getInstrumentation().callActivityOnPause(component));
 return this;
}

代码示例来源:origin: ksoichiro/Android-ObservableScrollView

@Override
  public void run() {
    Bundle outState = new Bundle();
    test.getInstrumentation().callActivityOnSaveInstanceState(activity, outState);
    test.getInstrumentation().callActivityOnPause(activity);
    test.getInstrumentation().callActivityOnResume(activity);
    test.getInstrumentation().callActivityOnRestoreInstanceState(activity, outState);
  }
});

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

@Override
public void callActivityOnPause(Activity activity) {
  PluginInjector.injectInstrumetionFor360Safe(activity, this);
  real.callActivityOnPause(activity);
  monitor.onActivityPause(activity);
}

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

@Override
public void callActivityOnPause(Activity activity) {
  base.callActivityOnPause(activity);
}

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

@Override
public void callActivityOnPause(Activity activity) {
  base.callActivityOnPause(activity);
}

代码示例来源:origin: gdpancheng/LoonAndroid3

@Override
public void callActivityOnPause(Activity activity) {
  AnalysisManager.analysisProcess(activity, LoonConstant.Number.ACTIVITY_PAUSE);
  super.callActivityOnPause(activity);
}

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

@Override
@CallSuper
public void callActivityOnPause(Activity activity) {
  if (DEBUG) {
    Logger.d(TAG,"callActivityOnStop");
  }
  mInstrumentation.callActivityOnPause(activity);
}

代码示例来源:origin: stackoverflow.com

ins.callActivityOnPause(launchActivity);
assertEquals(true, true);
ins.callActivityOnResume(launchActivity);

代码示例来源:origin: org.robolectric/shadows-framework

public ActivityController<T> pause() {
 shadowMainLooper.runPaused(() -> getInstrumentation().callActivityOnPause(component));
 return this;
}

代码示例来源:origin: stackoverflow.com

@UiThreadTest
public void testResumeAfterStop() {
  Instrumentation instr = this.getInstrumentation();

  // here, test or record down whatever should be tested 
  // when the activity is in resume state the first time

  instr.callActivityOnPause(getActivity());
  instr.callActivityOnStop(getActivity());
  instr.callActivityOnRestart(getActivity());
  instr.callActivityOnStart(getActivity());
  instr.callActivityOnResume(getActivity());

  // Now you are in the resume state again. 
  // Test whatever you need here.

}

代码示例来源:origin: blurpy/kouchat-android

public void run() {
    getInstrumentation().callActivityOnPause(solo.getCurrentActivity());
  }
});

代码示例来源:origin: blurpy/kouchat-android

public void run() {
    getInstrumentation().callActivityOnPause(solo.getCurrentActivity());
  }
});

代码示例来源:origin: blurpy/kouchat-android

public void run() {
    getInstrumentation().callActivityOnPause(solo.getCurrentActivity());
  }
});

代码示例来源:origin: blurpy/kouchat-android

public void run() {
    getInstrumentation().callActivityOnPause(solo.getCurrentActivity());
  }
});

代码示例来源:origin: blurpy/kouchat-android

public void run() {
    getInstrumentation().callActivityOnPause(solo.getCurrentActivity());
  }
});

代码示例来源:origin: blurpy/kouchat-android

public void run() {
    getInstrumentation().callActivityOnPause(solo.getCurrentActivity());
  }
});

代码示例来源:origin: THEONE10211024/ApiDemos

/**
 * This test demonstrates ways to exercise the Activity's life cycle.
 */
@MediumTest
public void testLifeCycleCreate() {
  Forwarding activity = startActivity(mStartIntent, null, null);
  
  // At this point, onCreate() has been called, but nothing else
  // Complete the startup of the activity
  getInstrumentation().callActivityOnStart(activity);
  getInstrumentation().callActivityOnResume(activity);
  
  // At this point you could test for various configuration aspects, or you could 
  // use a Mock Context to confirm that your activity has made certain calls to the system
  // and set itself up properly.
  
  getInstrumentation().callActivityOnPause(activity);
  
  // At this point you could confirm that the activity has paused properly, as if it is
  // no longer the topmost activity on screen.
  
  getInstrumentation().callActivityOnStop(activity);
  
  // At this point, you could confirm that the activity has shut itself down appropriately,
  // or you could use a Mock Context to confirm that your activity has released any system
  // resources it should no longer be holding.
  // ActivityUnitTestCase.tearDown(), which is always automatically called, will take care
  // of calling onDestroy().
}

代码示例来源:origin: qiubiteme/android_api_demos

/**
 * This test demonstrates ways to exercise the Activity's life cycle.
 */
@MediumTest
public void testLifeCycleCreate() {
  Forwarding activity = startActivity(mStartIntent, null, null);
  
  // At this point, onCreate() has been called, but nothing else
  // Complete the startup of the activity
  getInstrumentation().callActivityOnStart(activity);
  getInstrumentation().callActivityOnResume(activity);
  
  // At this point you could test for various configuration aspects, or you could 
  // use a Mock Context to confirm that your activity has made certain calls to the system
  // and set itself up properly.
  
  getInstrumentation().callActivityOnPause(activity);
  
  // At this point you could confirm that the activity has paused properly, as if it is
  // no longer the topmost activity on screen.
  
  getInstrumentation().callActivityOnStop(activity);
  
  // At this point, you could confirm that the activity has shut itself down appropriately,
  // or you could use a Mock Context to confirm that your activity has released any system
  // resources it should no longer be holding.
  // ActivityUnitTestCase.tearDown(), which is always automatically called, will take care
  // of calling onDestroy().
}

相关文章

Instrumentation类方法