Package com.pspdfkit.document
Class ImageDocumentUtils
-
- All Implemented Interfaces:
public class ImageDocumentUtils
Collection of helper methods for working with ImageDocuments.
-
-
Constructor Summary
Constructors Constructor Description ImageDocumentUtils()
-
Method Summary
Modifier and Type Method Description static void
refreshMediaStore(@NonNull() Context context, @NonNull() ImageDocument imageDocument)
Sends a media scanner broadcast intent that will trigger a re-scanning of the 's original image file. static boolean
isImageUri(@NonNull() Context context, @NonNull() Uri uri)
Checks whether the content returned by resolving uri
has an image MIME type.-
-
Method Detail
-
refreshMediaStore
static void refreshMediaStore(@NonNull() Context context, @NonNull() ImageDocument imageDocument)
Sends a media scanner broadcast intent that will trigger a re-scanning of the 's original image file. Using this method after saving an ImageDocument ensures that all Android media apps will show the latest version of that image.
This method is a no-op if
imageDocument
is not backed by file Uri - i.e. whenimageDocument.getImageDocumentSource().getFileUri()
returnsnull
.- Parameters:
context
- The context used to fire media scanner broadcast.imageDocument
- Document to scan.
-
isImageUri
static boolean isImageUri(@NonNull() Context context, @NonNull() Uri uri)
Checks whether the content returned by resolving
uri
has an image MIME type.- Parameters:
context
- The context used to resolve mime type via .uri
- A content provider URI with supported scheme (i.e.- Returns:
true
whenuri
points to image content (has mime typeimage/*
).
-
-
-
-