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

  • Home
  • SEARCH
  • 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 9218043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:46:19+00:00 2026-06-18T02:46:19+00:00

I would like to load a large/complex svg image file into my imageView. Loading

  • 0

I would like to load a large/complex svg image file into my imageView. Loading the svg takes time to load on my HTC Desire S and Lenovo a60. About 5 Second and 10 seconds respectively.

Right now my app becomes unresponsive for about 5 seconds until the imageView is fully loaded

I load the image using this simple code..

    svg = SVGParser.getSVGFromResource(getResources(), R.raw.gf);
    mImageView.setImageDrawable(svg.createPictureDrawable());

I was looking something like (webView)

webView.setWebViewClient(new WebViewClientEx(MainActivity.this, DEBUG) {

 @Override
        public void onPageFinished(final WebView view, String url) {
 ...........
 .............}
 });

which I used in my previous project…

Finally my questions:

1.) What is the best approach to make the app look responsive?

I was planning to use asynctask but don’t know how to use it… Is it applicable here?

2.) Is there listener after the image is fully loaded?

My approach here is to show the progressDialog by the time I load the imageView and hide it after the imageView has fully loaded.

another other suggestions which you think is better to use for showing/hiding progressDialog ? Thanks!

  • 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-06-18T02:46:20+00:00Added an answer on June 18, 2026 at 2:46 am

    Use an async task here. (a Loader would work aswell but async task is a bit easier to explain.)

     private class LoadSVGTask extends AsyncTask<Integer, Void, Drawable> {
    
      protected Drawable doInBackground(Integer... res) {
      mProgressBar.setVisibility(View.Visible);
      svg = SVGParser.getSVGFromResource(getResources(),res); 
      Drawable d = svg.createPictureDrawable();
      return d;
     }
    
     // gets executed in main thread
     protected void onPostExecute(Drawable result) {
     mProgressBar.setVisibility(View.Gone);
         mImageView.setImageDrawable(result);
     }
    }
    

    Launch the Task with:

    new LoaderSVGTask().execute(R.raw.gf, null, null);
    

    see: http://developer.android.com/reference/android/os/AsyncTask.html

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

Sidebar

Related Questions

I would like to load some data stored in a file into my mysql
I have a very large javascript file I would like to load only if
I would like to load the contents of a text file into a vector<char>
i would like to load xml into dataset with only 2 columns (name, price)
$('#selector').click(function() { // here I would like to load a javascript file // let's
I have 20 large CSV (100-150MB each) files i would like to load in
I would like to be able to load data into a DataGrid in Silverlight
I have a very large site and it takes pretty long time to load.
I have a large XML file I would like to strip all the tags
I would like to load a new extension in a symfony2 project for twig

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.