Example usage for android.test ActivityInstrumentationTestCase2 getActivity

List of usage examples for android.test ActivityInstrumentationTestCase2 getActivity

Introduction

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

Prototype

@Override
public T getActivity() 

Source Link

Document

Get the Activity under test, starting it if necessary.

Usage

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

public static Activity launchSensorDataCollectorActivity(ActivityInstrumentationTestCase2<?> testCase) {
    Activity activity;//from   w w  w .ja v a 2s .c  o  m

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

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