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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:27:56+00:00 2026-05-28T16:27:56+00:00

Can any one tell me how to retrieve image from RSS feed and display

  • 0

Can any one tell me how to retrieve image from RSS feed and display it into listview. My everything is working…but unable to fetch the image form url.. I’ve written function for image lode also..but unable to take the url string for use. Even though I am able to display the url.
The code I tried..

public class RssFeedExampleTestImageActivity extends ListActivity 
{
    private ArrayList<RSSIteam> itemlist = null;
    private RSSListAdaptor rssadaptor = null;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);

        itemlist = new ArrayList<RSSIteam>();
        new RetrieveRSSFeeds().execute();

       RSSListAdaptor adapter = new RSSListAdaptor(this, R.layout.main, itemlist);
       setListAdapter(adapter);
    }

    //Function for loading image from web
    public static Drawable LoadImageFromWeb(String uri)
    {
        try 
        {
            InputStream is = (InputStream) new URL(uri).getContent();
            Drawable d = Drawable.createFromStream(is, "src name");
            return d;

        } 
        catch (Exception e) 
        {
            return null;
        }
    }

    private void retrieveRSSFeed(String urlToRssFeed,ArrayList<RSSIteam> list)
    {
        try
        {
           URL url = new URL(urlToRssFeed);
           SAXParserFactory factory = SAXParserFactory.newInstance();
           SAXParser parser = factory.newSAXParser();
           XMLReader xmlreader = parser.getXMLReader();

           RSSParser theRssHandler = new RSSParser(list);

           xmlreader.setContentHandler(theRssHandler);

           InputSource is = new InputSource(url.openStream());

           xmlreader.parse(is);
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    private class RetrieveRSSFeeds extends AsyncTask<Void, Void, Void>
    {
        private ProgressDialog progress = null;

        @Override
        protected Void doInBackground(Void... params) 
        {
            /*RSSIteam data = null;
            Uri custuri = Uri.parse(data.imageurl);
            String str = custuri.toString();
            LoadImageFromWeb(str);
            */
            retrieveRSSFeed("http://some_url",itemlist);

            rssadaptor = new RSSListAdaptor(RssFeedExampleTestImageActivity.this, R.layout.customlist, itemlist);
            return null;
        }

        @Override
        protected void onCancelled() 
        {
            super.onCancelled();
        }

        @Override
        protected void onPostExecute(Void result) 
        {
            setListAdapter(rssadaptor);

            progress.dismiss();
            super.onPostExecute(result);
        }

        @Override
        protected void onPreExecute() 
        {
            progress = ProgressDialog.show(RssFeedExampleTestImageActivity.this, null, "Loading RSS Feeds...");
            super.onPreExecute();
        }

        @Override
        protected void onProgressUpdate(Void... values) 
        {
            super.onProgressUpdate(values);
        }
    }

    private class RSSListAdaptor extends ArrayAdapter<RSSIteam>
    {
        private List<RSSIteam> objects = null;

        public RSSListAdaptor(Context context, int textViewResourceId, List<RSSIteam> objects) 
        {
            super(context, textViewResourceId, objects);
            this.objects = objects;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) 
        {
            View view = convertView;


             if(null == view)
            {
                    LayoutInflater vi = (LayoutInflater)RssFeedExampleTestImageActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                    view = vi.inflate(R.layout.customlist, null);
            }

             RSSIteam data = objects.get(position);

             if(null != data)
             {
                 Drawable imgLoad = null;
                     TextView title = (TextView)view.findViewById(R.id.txtViewTitle);
                     TextView description = (TextView)view.findViewById(R.id.txtViewDescription);
                     TextView imagetxt = (TextView)view.findViewById(R.id.txtViewImageUrl);

                     ImageView imageLoge = (ImageView)view.findViewById(R.id.imgViewLogo);

                     title.setText(data.title);
                     description.setText(data.description);
                     imagetxt.setText(data.imageurl);
                     /*imageLoge.setVisibility(View.VISIBLE);
                     imageLoge.setBackgroundDrawable(imgLoad);*/



             }
             return view;
        }
    }
}
  • 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-28T16:27:57+00:00Added an answer on May 28, 2026 at 4:27 pm

    Check this

    http://developer.android.com/resources/samples/XmlAdapters/index.html

    https://github.com/thest1/LazyList

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

Sidebar

Related Questions

can any one tell me how can change this java code into objective c.is
Can any one tell me how to convert an legacy application which is vb6
Can any one tell the bit size of boolean in Java?
Can any one tell me if its possible to create a stored procedure in
Can any one tell me how can i replace the slideup function with fadeout('slow')
Can any one tell me how to solve the following scenario in Asp.net application.
Can any one tell how to disable focus to a browser. Hi i am
Can any one tell me how to create the rounded button (Circular Button) in
Can any one tell me an opensource js library that can have a real-time
Can any one tell me why Objective-C is called a run-time language

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.