Is there anyway to save GIF image in gallery programatically?
<p>I am new to Android and I am implementing image gallery application. My question is that I want save GIF image in gallery. And I had done to save image in gallery but when I am saving GIF image in my gallery it will display normal image not GIF image. And I am using glide library to display GIF image in imageview.</p>

<p>Here this my code to save image in gallery</p>

<pre><code> save.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            drawable = getResources().getDrawable(imageRes);

            bitmap = ((BitmapDrawable)drawable).getBitmap();

            ImagePath = MediaStore.Images.Media.insertImage(
                    getContentResolver(),
                    bitmap,
                    "imageRes","imageRes"
            );

            URI = Uri.parse(ImagePath);

            Context context = getApplicationContext();

            // Create layout inflator object to inflate toast.xml file
            LayoutInflater inflater = getLayoutInflater();

            // Call toast.xml file for toast layout
            View toastRoot = inflater.inflate(R.layout.layout_toast3, null);

            Toast toast = new Toast(context);

            // Set layout to toast
            toast.setView(toastRoot);
            toast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL,
                    0,0 );
            toast.setDuration(Toast.LENGTH_LONG);
            toast.show();
        }
    });
</code></pre>

<p><strong>Imageadapter</strong></p>

<pre><code>public class ImageAdapter extends BaseAdapter {

static WallpaperInfo info;
private Context mContext;

public ImageAdapter() {


}

public int getCount() {
    return mThumbIds.length;
}
public Object getItem(int position) {
    return mThumbIds[position];
}
public long getItemId(int position) {
    return 0;
}
public ImageAdapter(Context c) {
    mContext = c;
}

public View getView(final int position, View convertView, ViewGroup parent) {
    ImageView imageView;
    if (convertView == null){
        imageView = new ImageView(mContext);
        imageView.setLayoutParams(new GridView.LayoutParams(200, 200));
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        imageView.setPadding(3, 3, 3, 3);
        imageView.setMaxHeight(300);
        imageView.setMaxWidth(300);
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                MyPreferenceActivity myPref = new MyPreferenceActivity(mContext);
                myPref.setGifImage(position);


                Intent intent = new Intent(mContext, FullScreenImage.class);
                intent.putExtra("imageID", mThumbIds[position]);
                /*intent.putExtra(EXTRA_LIVE_WALLPAPER_INTENT, intent);
                intent.putExtra(EXTRA_LIVE_WALLPAPER_SETTINGS, info.getSettingsActivity());
                intent.putExtra(EXTRA_LIVE_WALLPAPER_PACKAGE, info.getPackageName());*/
                mContext.startActivity(intent);
            }
        });

        Animation anim = AnimationUtils.loadAnimation(mContext.getApplicationContext(), R.anim.fly);
        imageView.setAnimation(anim);
        anim.start();

    }
    else{
        imageView = (ImageView) convertView;
    }
    imageView.setImageResource(mThumbIds[position]);
    return imageView;
}
public Integer[] mThumbIds = {
        R.drawable.gpp1, R.drawable.gpp2,
        R.drawable.gpp3,R.drawable.gpp4,
        R.drawable.gpp5,R.drawable.gpp6,
        R.drawable.gpp7,R.mipmap.h8,
        R.mipmap.h9,R.mipmap.h10,
        R.mipmap.h11,R.drawable.gp3,
        R.drawable.gp2,R.drawable.gp,
        R.drawable.onehalloween
};
}
</code></pre>

<p>So, how I can do this type of functionality in my app?</p>