Class ImageDocumentUtils

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageDocumentUtils

        ImageDocumentUtils()
    • 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. when imageDocument.getImageDocumentSource().getFileUri() returns null.

        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 when uri points to image content (has mime type image/*).