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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:47:26+00:00 2026-06-03T13:47:26+00:00

How to display images fetched from url on listfield asynchronously? I am getting exception

  • 0

How to display images fetched from url on listfield asynchronously? I am getting exception when i run the code. Here is my code. I am getting Uncaught NoClassFoundError

private Bitmap getBitmap(final String strEventCode)
{
    if(hst.containsKey(strEventCode))
        return (Bitmap) hst.get(strEventCode);
    else
    {           
        Thread t = new Thread(new Runnable() 
        {
            public void run() 
            {                       
                Bitmap bmp = HttpUtils.getBitmap(strHalfUrl+strEventCode+".jpg");
                hst.put(strEventCode, bmp);
            }
        });
        t.start();
    }
    return null; 
}

I draw image using following code using ListFieldCallBack:

class ListCallBack implements ListFieldCallback
{       
   public  void drawListRow(final ListField list, final net.rim.device.api.ui.Graphics g, final int index, final int y, final int w)
   {                  
       Event objEvent = (Event) eventData.elementAt(index);
       if(list.getSelectedIndex() == index)
       {              
           g.setColor(Color.LIGHTGRAY);
           g.fillRect(0, y, getWidth(), getHeight());            
       }
       Bitmap bmp = getBitmap(objEvent.getStrName());
       if(bmp==null)
           g.drawBitmap(0, y+5, loadingImage.getWidth(),loadingImage.getHeight(),loadingImage, 0, 0);
       else
           g.drawBitmap(0, y+5, bmp.getWidth(),bmp.getHeight(),bmp, 0, 0);

       g.setColor(Color.BLACK);
       int yPos = y + list.getRowHeight() - 1;
       g.drawLine(0, yPos, w, yPos);

       //final Bitmap b=(Bitmap)myImages.elementAt(index);
       //g.drawBitmap(0, y+5, b.getWidth(),b.getHeight(),b, 0, 0);         
   } 
   public Object get(ListField list, int index)
   { 
       return eventData.elementAt(index); 
   } 
   public int getPreferredWidth(ListField list)
   {
       return Display.getWidth();
   }
   public int indexOfList(ListField listField, String prefix, int start) 
   {
      return eventData.indexOf(prefix,start);
   }
}
  • 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-03T13:47:27+00:00Added an answer on June 3, 2026 at 1:47 pm

    What is HttpUtils.getBitmap()? If it is Java code written for Java-SE, then it will not work well on a BlackBerry, as BlackBerry devices only support Java-ME, which has substantially less capability than a modern Java-SE runtime.

    As for the async loading, you need to pass an event back to the UI once the fetch is complete. If you are fetching many photos at once, you will also want to add some sort of batching to that event, as sending an event for each photo can overrun the event queue on the UI app.

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

Sidebar

Related Questions

I want to display images on a .net page which I load from database
I am looking for a way to display images on my UI from a
I'm trying to display images I've loaded previously on a view but getting no
Ok, so I have a script to fetched images from Google's Picasa image service
I am trying to display an image which is fetched from the database as
In my app I display images I get from external DLLs, by binding the
I am using this code to display all the rows from database, but when
I'm trying to display images from android internal storage, I have only 4images(the images
I'm trying to display images from a database table to my dataGridView control. Other
How to display images from a folder in a gridview whose path is stored

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.