title: convert byte array into gif in java/android
body: <p>In my android app i receive an array of bytes from a server and have to convert them into a .gif image and then place it in a view.
  I already know how to convert them into a still image using BitmapFactory, but the images always come out still.
  I am using <a href="https://github.com/koral--/android-gif-drawable" rel="nofollow">gif-drawable</a> as my container view for the .gif image. I have tested it with a local animated gif and it works great.
  How can i put the byte array into the gif-drawable view?</p>
  
  <p>in the layout i have this:</p>
  
  <pre><code>&lt;pl.droidsonroids.gif.GifImageView
              android:id="@+id/imgExerciseImage"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:adjustViewBounds="true"
              android:contentDescription="exercise image" /&gt;
  </code></pre>
  
  <p>this is a view similar to an ImageView that can display animated gifs</p>
  
  <p>I Want to display in it an image that i receive from my firebase server. this is the code:</p>
  
  <pre><code>imageRef.getBytes(DatabaseConstants.ONE_MEGABYTE * 3).addOnSuccessListener(new OnSuccessListener&lt;byte[]&gt;() {
              @Override
              public void onSuccess(byte[] bytes) {
                  Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
                  imgExerciseImage.setImageBitmap(bitmap);
                  progressDialog.dismiss();
              }
          }
  </code></pre>
  
  <p>the byte[] is the animated gif. but in order to put it in my view i have to use the byte[] to form an image. in this example, im using BitmapFactory to create a bitmap. how can i create a gif instead of a bitmap?</p>