Example usage for Java android.app Instrumentation fields, constructors, methods, implement or subclass
The text is from its open source code.
void | addMonitor(ActivityMonitor monitor) Add a new ActivityMonitor that will be checked whenever an activity is started. |
ActivityMonitor | addMonitor(IntentFilter filter, ActivityResult result, boolean block) A convenience wrapper for #addMonitor(ActivityMonitor) that creates an intent filter matching ActivityMonitor for you and returns it. |
ActivityMonitor | addMonitor(String cls, ActivityResult result, boolean block) A convenience wrapper for #addMonitor(ActivityMonitor) that creates a class matching ActivityMonitor for you and returns it. |
void | checkStartActivityResult(int res, Object intent) |
Context | getContext() Return the Context of this instrumentation's package. |
Context | getTargetContext() Return a Context for the target application being instrumented. |
boolean | invokeContextMenuAction(Activity targetActivity, int id, int flag) Show the context menu for the currently focused view and executes a particular context menu item. |
boolean | invokeMenuActionSync(Activity targetActivity, int id, int flag) Execute a particular menu item. |
Application | newApplication(Class> clazz, Context context) Perform instantiation of the process's Application object. |
void | runOnMainSync(Runnable runner) Execute a call on the application's main thread, blocking until it is complete. |
void | sendCharacterSync(int keyCode) Higher-level method for sending both the down and up key events for a particular character key code. |
void | sendKeyDownUpSync(int key) Sends an up and down key event sync to the currently focused window. |
void | sendPointerSync(MotionEvent event) Dispatch a pointer event. |
void | sendTrackballEventSync(MotionEvent event) Dispatch a trackball event. |
Activity | startActivitySync(Intent intent) Start a new activity and wait for it to begin running before returning. |
void | waitForIdleSync() Synchronously wait for the application to be idle. |