Class ImageLoadingThread

  • All Implemented Interfaces:
    java.lang.Runnable

    public class ImageLoadingThread
    extends java.lang.Object
    implements java.lang.Runnable
    This background thread is defined for loading images from MediaStore
    Since:
    2022-02-28
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MSG_IMAGES  
      static java.lang.String MSG_SIZE  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageLoadingThread​(android.os.Handler objHandler, ImageGalleryActivity imageGalleryActivity)
      This constructor is used to initialise the instance of background thread
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()
      Overrides run function, get called when the thread is started.
      • Methods inherited from class java.lang.Object

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

      • ImageLoadingThread

        public ImageLoadingThread​(android.os.Handler objHandler,
                                  ImageGalleryActivity imageGalleryActivity)
        This constructor is used to initialise the instance of background thread
        Parameters:
        objHandler - Handler
        imageGalleryActivity - ImageGalleryActivity
    • Method Detail

      • run

        public void run()
        Overrides run function, get called when the thread is started. This threads executes loadImages(), puts ArrayList of images to Bundle, sets that Bundle to Message and sends that Message to Handler to proceed with main application. Code reference to run android tasks in background thread:
        Specified by:
        run in interface java.lang.Runnable
        See Also:
        Running android tasks in background thread