IT. Expert System.

Android Reference

ActivityInstrumentationTestCase2


android.test

Class ActivityInstrumentationTestCase2<T extends Activity>

    • Constructor Detail

      • ActivityInstrumentationTestCase2

        public ActivityInstrumentationTestCase2(Class<T> activityClass)
        Parameters:
        activityClass - The activity to test. This must be a class in the instrumentation targetPackage specified in the AndroidManifest.xml
    • Method Detail

      • getActivity

        public T getActivity()
        Get the Activity under test, starting it if necessary. For each test method invocation, the Activity will not actually be created until the first time this method is called.

        If you wish to provide custom setup values to your Activity, you may call setActivityIntent(Intent) and/or setActivityInitialTouchMode(boolean) before your first call to getActivity(). Calling them after your Activity has started will have no effect.

        NOTE: Activities under test may not be started from within the UI thread. If your test method is annotated with UiThreadTest, then your Activity will be started automatically just before your test method is run. You still call this method in order to get the Activity under test.

        Overrides:
        getActivity in class ActivityTestCase
        Returns:
        the Activity under test
      • setActivityIntent

        public void setActivityIntent(Intent i)
        Call this method before the first call to getActivity() to inject a customized Intent into the Activity under test.

        If you do not call this, the default intent will be provided. If you call this after your Activity has been started, it will have no effect.

        NOTE: Activities under test may not be started from within the UI thread. If your test method is annotated with UiThreadTest, then you must call setActivityIntent(Intent) from setUp().

        The default Intent (if this method is not called) is: action = Intent.ACTION_MAIN flags = Intent.FLAG_ACTIVITY_NEW_TASK All other fields are null or empty.

        Parameters:
        i - The Intent to start the Activity with, or null to reset to the default Intent.
      • setActivityInitialTouchMode

        public void setActivityInitialTouchMode(boolean initialTouchMode)
        Call this method before the first call to getActivity() to set the initial touch mode for the Activity under test.

        If you do not call this, the touch mode will be false. If you call this after your Activity has been started, it will have no effect.

        NOTE: Activities under test may not be started from within the UI thread. If your test method is annotated with UiThreadTest, then you must call setActivityInitialTouchMode(boolean) from setUp().

        Parameters:
        initialTouchMode - true if the Activity should be placed into "touch mode" when started
      • tearDown

        protected void tearDown()
                         throws Exception
        Description copied from class: InstrumentationTestCase
        Make sure all resources are cleaned up and garbage collected before moving on to the next test. Subclasses that override this method should make sure they call super.tearDown() at the end of the overriding method.
        Overrides:
        tearDown in class InstrumentationTestCase
        Throws:
        Exception


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 820 / 96446738. Delta: 0.02754 с