Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7439199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:40:18+00:00 2026-05-29T10:40:18+00:00

In a nutshell, I’m trying to display an animated GIF in a webview. This

  • 0

In a nutshell, I’m trying to display an animated GIF in a webview. This webview is in a list item. So, there is a listview of different gifs.

I’m setting the gifs on the listview like so:

View v = convertView;
if (v == null || position == 1) {
    LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    v = vi.inflate(R.layout.routine_exercise_item, parent, false);
}
TextView t = (TextView)v.findViewById(R.id.routine_exercise_num);
t.setText(getResources().getString(R.string.other_exercise) + " " + (position));

t = (TextView)v.findViewById(R.id.routine_exercise_description);
t.setText(mitems.get(position).description);



WebView anim = (WebView)v.findViewById(R.id.routine_exercise_gif);
anim.loadUrl("file:///android_asset/" + mitems.get(position).imagePath);
anim.setBackgroundColor(0);

I’m doing this inside getView of an ArrayAdapter<> subclass.

Everything loads just fine and the gif works… However, as soon as it’s displayed, my heap grows like crazy. It only takes 30-45 seconds for the heap to hit 32MB on my EVO 3d and crash.

I’m not sure what I’m doing wrong for such a memory leak to happen.

Any tips?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:40:19+00:00Added an answer on May 29, 2026 at 10:40 am

    Oof. A WebView per ListView item? Yeah, they’re heavy. I don’t necessarily see anything that would cause the behavior you’re seeing, but utilizing a WebView just to show a GIF is a bit overkill. Take a look at this tutorial on a View subclass that uses android.graphics.movie to display animated GIFs. Might be lighter than WebViews.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem in a nutshell: This is what happens when trying to insert a
In a nutshell, there's a global stylesheet: a { font-family: Arial; } I want
I was reading Algorithms in a Nutshell (O'Reilly) and came across this symbol in
My controller, in a nutshell is this: chart1.SeriesCollection.Add(SC); using (MemoryStream ms = chart1.GetChartStream()) {
Here are the specs that I'm trying to implement in a nutshell: 1) Some
Here's what I've been trying to do, in a nutshell: class example <T extends
In a nutshell , I want to have different faces for some types of
In a nutshell, this is my problem: private string publicKeyString = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVGUzbydMZS+fnkGTsUkDKEyFOGwghR234d5GjPnMIC0RFtXtw2tdcNM8I9Qk+h6fnPHiA7r27iHBfdxTP3oegQJWpbY2RMwSmOs02eQqpKx4QtIjWqkKk2Gmck5cll9GCoI8AUAA5e0D02T0ZgINDmo5yGPhGAAmqYrm8YiupwQIDAQAB; /* Some
My question in a nutshell is: Is there a correlation between the number of
In the book 'C++ In A Nutshell', there is the following example code std::vector<int>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.