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 8533685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:01:27+00:00 2026-06-11T10:01:27+00:00

I have downloaded one ImageDownloader code from gitHub( from Here ) Now when I

  • 0

I have downloaded one ImageDownloader code from gitHub(from Here)
Now when I am trying to download the image from my webservice I am getting this Runtime Exception “ImageLoader must be init with configuration before using”.

I am not able to figure it out.

And this my adapter:

public class CustomAdapter extends BaseAdapter 
{
    private Context context;
    private ArrayList<String> logo_URL;

    private ListContent listContent;
    private ArrayList< TeamDataClass> teamdata = null;
    private ArrayList<EventDataClass> eventdata = null;
    private DisplayImageOptions options;
    private ImageLoader imageLoader;

    public CustomAdapter(Context context,ArrayList<String> logo_URL,ArrayList<TeamDataClass> teamdata, ArrayList<EventDataClass> eventdata) 
    {
        this.context = context;
        this.logo_URL = logo_URL;
        this.teamdata = teamdata;
        this.eventdata = eventdata;
        options = new DisplayImageOptions.Builder()
        .showImageForEmptyUri(R.drawable.image_for_empty_url)
        .cacheOnDisc()
        .imageScaleType(ImageScaleType.EXACT)
        .build();
        imageLoader= ImageLoader.getInstance();
    } 

    //@Override
    public int getCount() 
    {
        return teamdata.size()/2;
    }

    //@Override
    public Object getItem(int arg0) 
    {
        return arg0;
    }

    //@Override
    public long getItemId(int arg0) 
    {
        return arg0;
    }

    //@Override
    public View getView(int arg0, View convertview, ViewGroup arg2) 
    {
        LayoutInflater inflater = ((Activity) context).getLayoutInflater();
        if (convertview == null ) 
        {
            convertview = inflater.inflate(R.layout.custom_list_score, null);
            listContent = new ListContent();
            listContent.team_logo2 = (ImageView) convertview.findViewById(R.id.team_logo2);
            listContent.team_logo1 = (ImageView) convertview.findViewById(R.id.team_logo1);
            listContent.progress_team1=(ProgressBar)convertview.findViewById(R.id.progress_team_logo1);
            listContent.progress_team2=(ProgressBar)convertview.findViewById(R.id.progress_team_logo2);

            convertview.setTag(listContent);
        }
        else 
        {
            listContent = (ListContent) convertview.getTag();
        }
        listContent.status.setText(eventdata.get(arg0).status);
        int pos=arg0*2;
        imageLoader.displayImage(logo_URL.get(pos),listContent.team_logo1, options,new ImageLoadingListener() 
        {
            //@Override
            public void onLoadingStarted()
            {
                listContent.progress_team1.setVisibility(View.VISIBLE);
            }

            //@Override
            public void onLoadingFailed(FailReason failReason)
            {
                String message = null;
                switch (failReason) 
                {
                    case IO_ERROR:
                        message = "Input/Output error";
                        break;
                    case OUT_OF_MEMORY:
                        message = "Out Of Memory error";
                        break;
                    case UNKNOWN:
                        message = "Unknown error";
                        break;
                }
                Toast.makeText(context, message, Toast.LENGTH_SHORT).show();

                listContent.progress_team1.setVisibility(View.GONE);
                listContent.team_logo1.setImageResource(android.R.drawable.ic_delete);
            }

            //@Override
            public void onLoadingComplete(Bitmap loadedImage)
            {
                listContent.progress_team1.setVisibility(View.GONE);
                Animation anim = AnimationUtils.loadAnimation(context, R.anim.fade_in);
                listContent.team_logo1.setAnimation(anim);
                anim.start();
            }

            //@Override
            public void onLoadingCancelled()
            {
                // Do nothing
            }

            public void onLoadingComplete() {

            }
        }); 
        imageLoader.displayImage(logo_URL.get(pos+1),listContent.team_logo2, options,new ImageLoadingListener() 
        {
            //@Override
            public void onLoadingStarted()
            {
                listContent.progress_team2.setVisibility(View.VISIBLE);
            }

            //@Override
            public void onLoadingFailed(FailReason failReason)
            {
                String message = null;
                switch (failReason) 
                {
                    case IO_ERROR:
                        message = "Input/Output error";
                        break;
                    case OUT_OF_MEMORY:
                        message = "Out Of Memory error";
                        break;
                    case UNKNOWN:
                        message = "Unknown error";
                        break;
                }
                Toast.makeText(context, message, Toast.LENGTH_SHORT).show();

                listContent.progress_team2.setVisibility(View.GONE);
                listContent.team_logo2.setImageResource(android.R.drawable.ic_delete);
            }

            //@Override
            public void onLoadingComplete(Bitmap loadedImage)
            {
                listContent.progress_team2.setVisibility(View.GONE);
                Animation anim = AnimationUtils.loadAnimation(context, R.anim.fade_in);
                listContent.team_logo2.setAnimation(anim);
                anim.start();
            }

            //@Override
            public void onLoadingCancelled()
            {
                // Do nothing
            }

            public void onLoadingComplete() {

            }
        }); 

        return convertview;
    }
    private class ListContent
    {
        ImageView team_logo1, team_logo2;
        ProgressBar progress_team1,progress_team2;
    }
}

This is my logcat:

FATAL EXCEPTION: main
java.lang.RuntimeException: ImageLoader must be init with configuration before using
at com.nostra13.universalimageloader.core.ImageLoader.displayImage(ImageLoader.java:164)
at com.huskerit.score.CustomAdapter.getView(CustomAdapter.java:100)
at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
at android.widget.AbsListView.obtainView(AbsListView.java:1554)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1288)
at android.widget.ListView.onMeasure(ListView.java:1199)
at android.view.View.measure(View.java:8313)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1017)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:701)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:311)
at android.view.View.measure(View.java:8313)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1017)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:386)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)
at android.view.View.measure(View.java:8313)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
at android.view.View.measure(View.java:8313)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
at android.view.View.measure(View.java:8313)
at android.view.ViewRoot.performTraversals(ViewRoot.java:844)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
  • 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-11T10:01:29+00:00Added an answer on June 11, 2026 at 10:01 am

    I have added this line in my Constructor and its worked for me…

    imageLoader.init(ImageLoaderConfiguration.createDefault(context));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have downloaded follwing code from one of Google Codes but problem is in
I have downloaded the latest GLUI source code and now I am trying to
I have downloaded Play Framework from GitHub and compiled it. Now I want to
Hey I have downloaded one of the xml editors from some site. But don't
I am trying to make a Postgres PHP backup script. I have downloaded one
I have prepared one sample application.When application install in devices download the file from
i have added a custom font - one which i have downloaded from from
I have downloaded ZXing 1.5 and am trying to include this in my iPhone
I have Downloaded demo project from here I tried to run Silverlight project SkiResult.ThinClient
I have downloaded the sample code GLPaint from developer.Apple website to draw pictures on

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.