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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:27:03+00:00 2026-05-22T17:27:03+00:00

Below is my code. I am getting url for an image through JSONArray. Then

  • 0

Below is my code. I am getting url for an image through JSONArray. Then i converted the image to Bitmap image and stored in Hashtable.

I am using ImageView to show the images in listview. So i am using simple adapter for getting images. But image is not loading.

Please help me out of this, I am new to Android!!!!!!

ArrayList<Hashtable<String, Bitmap>> mylist1 = new ArrayList<Hashtable<String, Bitmap>>();

try{                
    JSONArray  earthquakes = json.getJSONArray("earthquakes");              
    for(int i=0;i<10;i++){                      
        imagemap = new Hashtable<String, Bitmap>();
        JSONObject e = earthquakes.getJSONObject(i);
        try
        {
            aURL = new URL(photo);
        }
        catch (MalformedURLException e1)
        {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        URLConnection conn = null;
        try
        {
            conn = aURL.openConnection();
        }
        catch (IOException e1)
        {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        try
        {
            conn.connect();
        }
        catch (IOException e1)
        {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        InputStream is = null;
        try
        {
            is = conn.getInputStream();
        }
        catch (IOException e1)
        {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        BufferedInputStream bis = new

        BufferedInputStream(is,8*1024);

        Bitmap bm = BitmapFactory.decodeStream(bis);

        imagemap.put("im",bm);

        mylist1.add(imagemap);
        ListAdapter adapter = new SimpleAdapter(this,mylist1,R.layout.main,new String[] {"im"},new int[] {R.id.image});

        setListAdapter(adapter);

Update:

Below is the ArrayAdapter i used to load the string to text fields in the listview.
I have one ImageView in it. How to override the listadapter to load the dynamic images into the listview.

ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.main4, 
                       new String[] { "percent","propertyid",  "cityname", "statecode", "propertytype", "footage", "bathroom", "bedroom", "price", "estimated" }, 
                        new int[] { R.id.percent, R.id.property_id,  R.id.city_name, R.id.state_code, R.id.prop_type, R.id.foot, R.id.bath, R.id.bed, R.id.list, R.id.estimat});

setListAdapter(adapter);
  • 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-22T17:27:04+00:00Added an answer on May 22, 2026 at 5:27 pm

    This is how I put an image inside a listview

    public View getView(int position, View convertView, ViewGroup parent) {
        View vi=convertView;
        ViewHolder holder;
        if(convertView==null){
            vi = inflater.inflate(R.layout.highscore_item, null);
            holder=new ViewHolder();
            holder.Icon=(ImageView)vi.findViewById(R.id.icon);
            vi.setTag(holder);
        }
        else
            holder=(ViewHolder)vi.getTag();
        holder.Icon.setTag(mData[position].getIcon());
        imageLoader.DisplayImage(mData[position].getIcon(), activity, holder.Icon);
        return vi;
    }
    

    Take a look at Lazylist if you want more info.

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

Sidebar

Related Questions

I am getting image from an url. I am using imageview in listview. I
When i'm displaying image from url with using below code, application is taking too
C# 2008 SP1 I am using the code below: dt.ReadXml(%AppData%\\DateLinks.xml); However, I am getting
I'm getting some very jerky scrolling while using the code below to create a
I am getting below error. java.lang.NullPointerException 11-14 16:46:59.093: E/AndroidRuntime(4064): at android.content.ContextWrapper.getContentResolver(ContextWrapper.java:90) Using below code.
I am using this below code to re-write URL : RewriteEngine on RewriteRule ^buynow/(.*)$
I have the code below for getting a list of child processes on windows
I am getting an compilation error not a statement for the below code. Not
In the below code how to remove the hyperlink after getting the innerHTML :
From the code below I am getting a cell value from the selected row

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.