Skip to content Skip to sidebar Skip to footer

Gif Not Animated In Custom Listview

I want to display animated GIF images in my custom listview.my GIF image is get in web service url.GIF image displayed but not animated. public class NewsScreenAdapter extends

Solution 1:

You can use Android Movie class that is able to decode gifs.

Movie.decodeStream(InputStream is);

Solution 2:

Use WebView rather then ImageView and loadUrl in WebView.

Solution 3:

you have to use gif decorder class for that and set it in inflact view so you can set two view in single activity or screen.

Solution 4:

Use the Glide image loading library, it has built-in support for GIFs and the syntax is the same loading a JPEG file:

Glide.with(this).load("http://.../anim.gif").into(imageView);

See the wiki for more and run the Gihpy sample to be amazed :)

Solution 5:

//-----------------GIF Image view ------------

holder.imgAdd.getSettings().setJavaScriptEnabled(true);

holder.imgAdd.setWebChromeClient(newWebChromeClient() {
    publicvoidonProgressChanged(WebView view, int progress)
    {
        activity.setTitle("Loading...");
        activity.setProgress(progress * 100);

        if(progress == 100)
            activity.setTitle(R.string.app_name);
    }
});

holder.imgAdd.setWebViewClient(newWebViewClient() {
    @OverridepublicvoidonReceivedError(WebView view, int errorCode, String description, String failingUrl)
    {
        // Handle the error
    }
    @OverridepublicbooleanshouldOverrideUrlLoading(WebView view, String url)
    {
        view.loadUrl(url);
        returntrue;
    }
});

            holder.imgAdd.loadUrl(imgUrl);

Post a Comment for "Gif Not Animated In Custom Listview"