This package is part of the
support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack.
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.
The Screenshot instance provides methods to capture a
instrumentation tests run on an android device.
The Screenshot instance keeps track of a set of
s that will be
passed to each
object when they are created during any test. These
s are capable of processing the
that was created.
This API is currently in beta.
wait(long arg0, int arg1)
ScreenCapture capture ()
that contains a
of the visible screen content
for Build.VERSION_CODES.JELLY_BEAN_MR2 and above.
that is returned will also contain the set of
s that have been set in this instance.
Note: Only use this method if all your tests run on API versions
Build.VERSION_CODES.JELLY_BEAN_MR2 or above. If you need to take screenshots on lower API
levels, you need to use
IllegalStateException if used on API below Build.VERSION_CODES.JELLY_BEAN_MR2
If there was an error capturing the screenshot