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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:52:08+00:00 2026-06-15T00:52:08+00:00

I am trying to make application for reading rss feeds. I made app,but it

  • 0

I am trying to make application for reading rss feeds. I made app,but it wont load feeds. I will give you code so you can tell me what I can change to make app working properly. I don’t know what the problem is. There is no errors in code but it wont load feeds.

ListActivity.java:

package com.listview;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListAdapter;
import android.widget.ListView;

public class ListActivity extends Activity {
ListView lv1;
ProgressDialog ShowProgress;
public ArrayList<Post> PostList = new ArrayList<Post>();

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list);

    lv1 = (ListView)findViewById(R.id.listView1);
    ShowProgress = ProgressDialog.show(ListActivity.this,"","Loading. Please wait...",true);
    new loadingTask().execute("av-gurus.blogspot.com/feeds/posts/default/");

    lv1.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent,View view,
                int position, long id){

            Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri
                    .parse(PostList.get(position).getUrl()));
            startActivity(intent);
        }
    });
}

class loadingTask extends AsyncTask<String, Void, String> {

    @Override
    protected String doInBackground(String... urls) {
        SAXHelper sh = null;
        try 
        {
            sh = new SAXHelper(urls[0]);
        }catch (MalformedURLException e){
            e.printStackTrace();
        }
        sh.parseContent("");
        return "";


        }
    protected void onPostExecute(String s) {
        lv1.setAdapter(new EfficientAdapter(ListActivity.this, PostList));
        ShowProgress.dismiss();
    }

}

class SAXHelper{
    public HashMap<String, String> userList = new HashMap<String, String>();
    private URL url2;

    public SAXHelper(String url1) throws MalformedURLException {
        this.url2 = new URL(url1);
    }

    public RSSHandler parseContent(String parseContent) {
        RSSHandler df = new RSSHandler();
        try {

            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser sp = spf.newSAXParser();
            XMLReader xr = sp.getXMLReader();
            xr.setContentHandler(df);
            xr.parse(new InputSource(url2.openStream()));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return df;
    }
}

class RSSHandler extends DefaultHandler {
    private Post currentPost = new Post();
    StringBuffer chars = new StringBuffer();

    @Override
    public void startElement(String uri, String localName, String qName,
            Attributes atts) {

        chars = new StringBuffer();
        if (localName.equalsIgnoreCase("item")) {

        }
    }
    @Override
    public void endElement(String uri, String localName, String qName)
            throws SAXException {

        if (localName.equalsIgnoreCase("title")
                && currentPost.getTitle() == null) {
            currentPost.setTitle(chars.toString());

        }
        if (localName.equalsIgnoreCase("pubDate")
                && currentPost.getPubDate() == null) {
            currentPost.setPubDate(chars.toString());

        }
        if (localName.equalsIgnoreCase("thumbnail")
                && currentPost.getThumbnail() == null) {
            currentPost.setThumbnail(chars.toString());

        }
        if (localName.equalsIgnoreCase("link")
                && currentPost.getUrl() == null) {
            currentPost.setUrl(chars.toString());
        }

        if (localName.equalsIgnoreCase("item")) {
            PostList.add(currentPost);
            currentPost = new Post();
        }

    }

    @Override
    public void characters(char ch[], int start, int length) {
        chars.append(new String(ch, start, length));

}
}
}

Post.java:

package com.listview;

public class Post {

private String title;
private String thumbnail;
private String url;
private String description;
private String pubDate;

public String getTitle() {
    return title;
}

public void setTitle(String title) {
    this.title = title;
}

public String getThumbnail() {
    return thumbnail;
}

public void setThumbnail(String thumbnail) {
    this.thumbnail = thumbnail;
}

public String getUrl() {
    return url;
}

public void setUrl(String url) {
    this.url = url;
}

public void setDescription(String description) {
    this.description = description;
}

public String getDescription() {
    return description;
}

public void setPubDate(String pubDate) {
    this.pubDate = pubDate;
}

public String getPubDate() {
    return pubDate;
}

}

EfficientAdapter.java:

package com.listview;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class EfficientAdapter extends BaseAdapter {
private Activity activity;
private ArrayList<Post> data;
private static LayoutInflater inflater = null;
//public ImageLoader imageLoader;
ViewHolder holder;

EfficientAdapter(Activity a, ArrayList<Post> d) {

    activity = a;
    data = d;
    inflater = (LayoutInflater) activity
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//  imageLoader = new ImageLoader(activity.getApplicationContext());

}

@Override
public int getCount() {
    return data.toArray().length;

}

@Override
public Object getItem(int position) {

    return position;
}

@Override
public long getItemId(int position) {

    return position;
}

public static class ViewHolder {
    public TextView label;
    public TextView addr;
    public ImageView image;
}

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

    if (convertView == null) {
        vi = inflater.inflate(R.layout.row, null);
        holder = new ViewHolder();
        holder.label = (TextView) vi.findViewById(R.id.title);
        holder.addr = (TextView) vi.findViewById(R.id.details);
        holder.image = (ImageView) vi.findViewById(R.id.thumb);
        vi.setTag(holder);
    } else
        holder = (ViewHolder) vi.getTag();

    holder.label.setText(data.get(position).getTitle());
    holder.addr.setText(data.get(position).getPubDate());

    imageLoader.DisplayImage((data.get(position).getThumbnail()), activity,
            holder.image, 72, 72);
    URL url = null;
    try {
        url = new URL((data.get(position).getThumbnail()));
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    InputStream content = null;
    try {
        content = (InputStream)url.getContent();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    Drawable d = Drawable.createFromStream(content , "src"); 
    Bitmap mIcon1 = null;
     try {
         mIcon1 =
                BitmapFactory.decodeStream(url.openConnection().getInputStream());
    } catch (IOException e) {
        e.printStackTrace();
    }
    holder.image.setImageBitmap(Bitmap.createScaledBitmap(mIcon1, 72, 72, false));


    return vi;
}

}

activity_list.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ListActivity" >

<ListView 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollingCache="false"
    android:background="#ffffff"
    android:cacheColorHint="#00000000"
    android:id="@+id/listView1">
</ListView>

</LinearLayout>

row.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/widget30"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:padding="4dip" xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:id="@+id/details" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:text="TextView"
    android:textColor="#000000" android:layout_toRightOf="@+id/icon"
    android:layout_alignLeft="@+id/title" android:layout_alignRight="@+id/title"
    android:layout_below="@+id/title" android:layout_marginRight="5px">
</TextView>
<TextView android:id="@+id/title" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:text="TextView"
    android:textStyle="bold" android:textColor="#000000"
    android:layout_marginTop="5px" android:layout_toRightOf="@+id/icon"
    android:layout_marginRight="5px">
</TextView>
<ImageView android:id="@+id/arrow" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:padding="0px"
    android:layout_marginRight="10px" android:src="@drawable/ic_launcher"
    android:layout_alignRight="@+id/icon" android:layout_alignParentRight="true"
    android:layout_centerVertical="true">
</ImageView>
<ImageView android:id="@+id/thumb" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:layout_marginRight="10px"
    android:layout_centerVertical="true" android:layout_alignParentLeft="true"
    android:src="@drawable/ic_launcher" android:minWidth="72dip"
    android:minHeight="72dip" android:maxWidth="72dip" android:maxHeight="72dip">
</ImageView>

</RelativeLayout>

LOG
http://pastebin.com/wnEZE92F

  • 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-15T00:52:09+00:00Added an answer on June 15, 2026 at 12:52 am
    "av-gurus.blogspot.com/feeds/posts/default/"
    

    this should be start with the http scheme (http://)

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

Sidebar

Related Questions

I've been reading posts all over and trying different approaches, but I can't make
I'm trying to make an application where the users can click on the buttons
I'm trying to make an application that changes the UI every minute, but I'm
I'm trying to make an image zoomable in my windows phone 7 application. (code
I'm trying to make application for tablet with Android 2.3 with this kind of
I am trying to make my application device administrator , i followed some notes
I am trying to make my application to use lookaside lists for memory management.
I'm trying to make an application that needs authentication :- when user type username
I am trying to make an application that should help making Dungeon and Dragons
I'm trying to make an application in which both the developer and the end

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.