com.brightcove.player.display.tasks

## Class LoadImageTask

- java.lang.Object
- - android.os.AsyncTask<java.net.URI,java.lang.Void,android.graphics.Bitmap>
  - - com.brightcove.player.display.tasks.LoadImageTask

- All Implemented Interfaces:
    Component

      @Emits(events={"didSetVideoStill","didSetVideoStillError"})
       @ListensFor(events={})
      public class LoadImageTask
      extends android.os.AsyncTask<java.net.URI,java.lang.Void,android.graphics.Bitmap>
      implements Component

  General purpose AsyncTask to load an image over the network into an ImageView. The Event type specified in the constructor will be emitted on successful load of an image.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class android.os.AsyncTask

      `android.os.AsyncTask.Status`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `TAG`

    - ### Fields inherited from class android.os.AsyncTask

      `SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LoadImageTask(android.widget.ImageView view, EventEmitter eventEmitter)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected android.graphics.Bitmap` | `doInBackground(java.net.URI... params)` Loads a Bitmap over the network using the given URL.
    `java.lang.String` | `getSuccessEventType()` Get the currently configured EventType string that is to be emitted on successful load of a Bitmap.
    `protected void` | `onPostExecute(android.graphics.Bitmap image)` On successful load of a Bitmap from the background thread, put that Bitmap in the ImageView provided to this task.
    `void` | `setSuccessEventType(java.lang.String type)` Set the EventType string to be emitted on successful load of a Bitmap.

    - ### Methods inherited from class android.os.AsyncTask

      `cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, onPreExecute, onProgressUpdate, publishProgress`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TAG

          public static final java.lang.String TAG

  - ### Constructor Detail

    - #### LoadImageTask

          public LoadImageTask(android.widget.ImageView view,
                               EventEmitter eventEmitter)

  - ### Method Detail

    - #### getSuccessEventType

          public java.lang.String getSuccessEventType()

      Get the currently configured EventType string that is to be emitted on successful load of a Bitmap.
      Returns:
        the EventType string to be used on success, or null if none is set

    - #### setSuccessEventType

          public void setSuccessEventType(java.lang.String type)

      Set the EventType string to be emitted on successful load of a Bitmap.
      Parameters:
        `type` - the EventType string

    - #### doInBackground

          protected android.graphics.Bitmap doInBackground(java.net.URI... params)

      Loads a Bitmap over the network using the given URL.
      Specified by:
        `doInBackground` in class `android.os.AsyncTask<java.net.URI,java.lang.Void,android.graphics.Bitmap>`
      Parameters:
        `params` - should contain a single URL object
      Returns:
        the Bitmap loaded from the network, or null if Bitmap could not be loaded

    - #### onPostExecute

          protected void onPostExecute(android.graphics.Bitmap image)

      On successful load of a Bitmap from the background thread, put that Bitmap in the ImageView provided to this task.
      Overrides:
        `onPostExecute` in class `android.os.AsyncTask<java.net.URI,java.lang.Void,android.graphics.Bitmap>`
      Parameters:
        `image` - the Bitmap that was loaded via background thread