Class AttachmentPicker


  • public class AttachmentPicker
    extends java.lang.Object
    This is used as a helper class in getting Intents for Newsfeed Attachment (for Newsfeed Post feature) It basically returns the Intent that is necessary to pick or capture images or videos.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean checkPermission​(android.content.Context context, int request)
      Helper method to check if permission is required, if required, this will show a dialog that starts the permission request
      static boolean clearUriString​(android.content.Context context)
      Clears uri string values from shared preferences.
      static android.content.Intent getImageIntents​(android.content.Context context)
      Get the Intent to be used for picking and capturing images.
      static android.content.Intent getImageIntents​(android.content.Context context, android.net.Uri uri)  
      static java.lang.String getUriString​(android.content.Context context)
      Fetches the uri string.
      static android.content.Intent getVideoIntent​(android.content.Context context)
      Get the Intent to be used for picking a video and capturing video.
      • Methods inherited from class java.lang.Object

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

      • AttachmentPicker

        public AttachmentPicker()
    • Method Detail

      • getVideoIntent

        public static android.content.Intent getVideoIntent​(android.content.Context context)
        Get the Intent to be used for picking a video and capturing video. For Video Capture, this method create a temporary video file where the captured video will be saved.
        Parameters:
        context - the application context
        Returns:
        Intent to be used for picking a video and capturing video.
      • getImageIntents

        public static android.content.Intent getImageIntents​(android.content.Context context)
        Get the Intent to be used for picking and capturing images.
        Parameters:
        context - the application context
        Returns:
        Intent to be used for picking and capturing images
      • getImageIntents

        public static android.content.Intent getImageIntents​(android.content.Context context,
                                                             android.net.Uri uri)
      • getUriString

        public static java.lang.String getUriString​(android.content.Context context)
        Fetches the uri string.
        Parameters:
        context - application context
        Returns:
        uri string
      • clearUriString

        public static boolean clearUriString​(android.content.Context context)
        Clears uri string values from shared preferences.
        Parameters:
        context - application context
        Returns:
        true if transaction is successful, else false
      • checkPermission

        public static boolean checkPermission​(android.content.Context context,
                                              int request)
        Helper method to check if permission is required, if required, this will show a dialog that starts the permission request
        Parameters:
        context - application context
        request - ID of the request
        Returns:
        True if permission is required, otherwise false