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

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

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

Instrumentation.onStart介绍

暂无

代码示例

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

@Override
public void onStart() {
  base.onStart();
}

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

@Override
public void onStart() {
  base.onStart();
}

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

@Override
public void onStart() {
  base.onStart();
}

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

@Override
@CallSuper
public void onStart() {
  if (DEBUG) {
    Logger.d(TAG,"onStart");
  }
  mInstrumentation.onStart();
}

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

@Override
  public void onStart() {
    super.onStart();
    // First start the activity we are instrumenting -- the contacts
    // list.
    Intent intent = new Intent(Intent.ACTION_MAIN);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setClassName(getTargetContext(),
        "com.android.phone.Dialer");
    Activity activity = startActivitySync(intent);

    // This is the Activity object that was started, to do with as we want.
    Log.i("ContactsFilterInstrumentation", "Started: " + activity);

    // We are going to enqueue a couple key events to simulate the user
    // filtering the list.  This is the low-level API so we must send both
    // down and up events.
    sendKeySync(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_M));
    sendKeySync(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_M));
    sendKeySync(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_A));
    sendKeySync(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_A));

    // Wait for the activity to finish all of its processing.
    waitForIdleSync();

    // And we are done!
    Log.i("ContactsFilterInstrumentation", "Done!");
    finish(Activity.RESULT_OK, null);
  }
}

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

@Override
  public void onStart() {
    super.onStart();
    // First start the activity we are instrumenting -- the contacts
    // list.
    Intent intent = new Intent(Intent.ACTION_MAIN);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setClassName(getTargetContext(),
        "com.android.phone.Dialer");
    Activity activity = startActivitySync(intent);

    // This is the Activity object that was started, to do with as we want.
    Log.i("ContactsFilterInstrumentation", "Started: " + activity);

    // We are going to enqueue a couple key events to simulate the user
    // filtering the list.  This is the low-level API so we must send both
    // down and up events.
    sendKeySync(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_M));
    sendKeySync(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_M));
    sendKeySync(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_A));
    sendKeySync(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_A));

    // Wait for the activity to finish all of its processing.
    waitForIdleSync();

    // And we are done!
    Log.i("ContactsFilterInstrumentation", "Done!");
    finish(Activity.RESULT_OK, null);
  }
}

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

@Override
public void onStart() {
  super.onStart();

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

@Override
public void onStart() {
  super.onStart();

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

@Override
public void onStart() {
  super.onStart();

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

@Override
public void onStart() {
  super.onStart();

相关文章

Instrumentation类方法