public class EspGalleryStub
extends java.lang.Object
Stubbing gallery picture request with Intent.ACTION_GET_CONTENT and MediaType.ANY_IMAGE_TYPE.
Typical application starts the gallery picker and use the reported Uri to access selected picture by ContentResolver. With this stubs you can avoid the start of the picture picker and let them report your preferred picture Uri. But you must provide the picture on your phone by self.
Example usage:
// provide a test picture
Uri pictureUri = EspFilesTool.copyFileFromAssetsToExternalCacheDir("picture_from_assets.jpg", "gallery_picture.jpg"
// register stub with your test picture uri
EspGalleryStub.register(pictureUri);
// now perform action to start gallery picture request
Base description for intent mocking.| Constructor and Description |
|---|
EspGalleryStub() |
| Modifier and Type | Method and Description |
|---|---|
static void |
register(android.net.Uri pictureLocation)
Register new stub for camera picture requests with
Activity.RESULT_OK. |