Example usage for android.test ActivityInstrumentationTestCase2 setActivityInitialTouchMode

List of usage examples for android.test ActivityInstrumentationTestCase2 setActivityInitialTouchMode

Introduction

In this page you can find the example usage for android.test ActivityInstrumentationTestCase2 setActivityInitialTouchMode.

Prototype

public void setActivityInitialTouchMode(boolean initialTouchMode) 

Source Link

Document

Call this method before the first call to #getActivity to set the initial touch mode for the Activity under test.

Usage

From source file:sysnetlab.android.sdc.test.TestHelper.java

public static Activity launchSensorDataCollectorActivity(ActivityInstrumentationTestCase2<?> testCase) {
    Activity activity;//from   ww w  .j  a v  a 2s . com

    testCase.setActivityInitialTouchMode(true);
    activity = testCase.getActivity();
    testCase.getInstrumentation().waitForIdleSync();

    Assert.assertTrue("The activity must be a SensorDataCollectorActivity.",
            activity instanceof SensorDataCollectorActivity);
    return activity;
}