IT. Expert System.

Android Reference

Instrumentation.ActivityMonitor


android.app

Class Instrumentation.ActivityMonitor

  • Enclosing class:
    Instrumentation


    public static class Instrumentation.ActivityMonitor
    extends Object
    Information about a particular kind of Intent that is being monitored. An instance of this class is added to the current instrumentation through Instrumentation.addMonitor(android.app.Instrumentation.ActivityMonitor); after being added, when a new activity is being started the monitor will be checked and, if matching, its hit count updated and (optionally) the call stopped and a canned result returned.

    An ActivityMonitor can also be used to look for the creation of an activity, through the waitForActivity() method. This will return after a matching activity has been created with that activity object.

    • Constructor Detail

      • Instrumentation.ActivityMonitor

        public Instrumentation.ActivityMonitor(IntentFilter which,
                                       Instrumentation.ActivityResult result,
                                       boolean block)
        Create a new ActivityMonitor that looks for a particular kind of intent to be started.
        Parameters:
        which - The set of intents this monitor is responsible for.
        result - A canned result to return if the monitor is hit; can be null.
        block - Controls whether the monitor should block the activity start (returning its canned result) or let the call proceed.
        See Also:
        Instrumentation.addMonitor(android.app.Instrumentation.ActivityMonitor)
      • Instrumentation.ActivityMonitor

        public Instrumentation.ActivityMonitor(String cls,
                                       Instrumentation.ActivityResult result,
                                       boolean block)
        Create a new ActivityMonitor that looks for a specific activity class to be started.
        Parameters:
        cls - The activity class this monitor is responsible for.
        result - A canned result to return if the monitor is hit; can be null.
        block - Controls whether the monitor should block the activity start (returning its canned result) or let the call proceed.
        See Also:
        Instrumentation.addMonitor(android.app.Instrumentation.ActivityMonitor)
    • Method Detail

      • getFilter

        public final IntentFilter getFilter()
        Retrieve the filter associated with this ActivityMonitor.
      • isBlocking

        public final boolean isBlocking()
        Check whether this monitor blocks activity starts (not allowing the actual activity to run) or allows them to execute normally.
      • getHits

        public final int getHits()
        Retrieve the number of times the monitor has been hit so far.
      • getLastActivity

        public final Activity getLastActivity()
        Retrieve the most recent activity class that was seen by this monitor.
      • waitForActivity

        public final Activity waitForActivity()
        Block until an Activity is created that matches this monitor, returning the resulting activity.
        Returns:
        Activity
      • waitForActivityWithTimeout

        public final Activity waitForActivityWithTimeout(long timeOut)
        Block until an Activity is created that matches this monitor, returning the resulting activity or till the timeOut period expires. If the timeOut expires before the activity is started, return null.
        Parameters:
        timeOut - Time to wait before the activity is created.
        Returns:
        Activity


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: 102 / 159228193. Delta: 0.04886 с