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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:28:41+00:00 2026-06-14T10:28:41+00:00

I want an RSS Feed displayed in an Android app. Basically, it’s reading from

  • 0

I want an RSS Feed displayed in an Android app. Basically, it’s reading from an XML file of course. There are two items I want displayed in the Android listView: title, description.

I want the feed to do this:

title
description

title
description

title
description

title
description

instead it is doing this:

title
title
title
title
title
title

description
description
description
description
description
description

I can see why based on how this code is, but I can’t figure out how to layout like example number 1.

Here is code:

private class RSSHandler extends DefaultHandler {

    public void startElement(String uri, String localName, String qName,
            Attributes attrs) throws SAXException {

        if (localName.equals("item")) {
            item = true;
        }

        if (localName.equalsIgnoreCase("title")) {
            fTitle = true;
        }

        if (localName.equalsIgnoreCase("description")) {
            fDesc = true;
        }

    }

    public void endElement(String namespaceURI, String localName,
            String qName) throws SAXException {

    }

    public void characters(char[] ch, int start, int length)
            throws SAXException {

        if (fTitle) {
            titleResult = titleResult + (new String(ch, start, length))
                    + "\t\n\n";
            fTitle = false;
        }

        if (fDesc) {
            rssResult = rssResult + (new String(ch, start, length))
                    + "\t\n\n";
            fDesc = false;
        }

    }

}
  • 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-14T10:28:42+00:00Added an answer on June 14, 2026 at 10:28 am

    You are maintaining two strings and combining them later, you should combine them as you build them. According to your example you should use something like this:

    public void characters(char[] ch, int start, int length)
            throws SAXException {
    
        if (fTitle) {
            titleResult = titleResult + (new String(ch, start, length))
                    + "\t\n";
            fTitle = false;
        }
    
        if (fDesc) {
            titleResult = titleResult + (new String(ch, start, length))
                    + "\t\n\n";
            fDesc = false;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a RSS feed into nsmutablearray. i want to search the xml
I have an XML file taken from an RSS feed, saved locally, and I
I want to save an RSS feed to an xml document on my computer.
I want to parse an existing RSS feed from another website with php and
There exists an RSS feed with over 1000 items. I want to create a
i made news applicaion in android using RSS feed and now i want to
I've got an Android activity which grabs an RSS feed from a URL, and
I want to be able to grab the links from an rss feed and
I am developing an Android application. In this application I want the RSS feed
i am creating an android app which fetches information from rss feeds...till now i

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.