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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:34:30+00:00 2026-06-12T10:34:30+00:00

I have previsously parsed this RSS Feed, now that I have updated it to

  • 0

I have previsously parsed this RSS Feed, now that I have updated it to use a AsyncTask it now displays a blank screen instead of a filled listview
CODE:

public class CustomizedListView extends Activity {

static String URL= "http://scout.org/rss/feed/all";
static final String KEY_ITEM = "item"; 
static final String KEY_TITLE = "title";
static final String KEY_DESCRIPTION = "description";
static final String KEY_LINK = "link";
static final String KEY_PUB_DATE = "pubDate";
 String PATH = Environment.getExternalStorageDirectory()
         + "/SCOUTS/";




ListView list;
LazyAdapter adapter;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.news);
    SharedPreferences sharedPrefs =   PreferenceManager.getDefaultSharedPreferences(this);
    URL= sharedPrefs.getString("news_feed", "-1");
    ArrayList<HashMap<String, String>> libraryList = new ArrayList<HashMap<String, String>>();
    list=(ListView)findViewById(R.id.listView1);            
    adapter=new LazyAdapter(CustomizedListView.this, libraryList);        
    list.setAdapter(adapter);
     new MyAsyncTask() .execute();
}

  class MyAsyncTask extends AsyncTask<String, Integer, ArrayList<HashMap<String, String>> > {
      private ProgressDialog progressDialog = new ProgressDialog(CustomizedListView.this);

        protected void onPreExecute() {
           progressDialog.setMessage("Loading Latest WOSM News");
           progressDialog.show();}

        ArrayList<HashMap<String, String>> libraryList = new ArrayList<HashMap<String, String>>();

              @Override
          protected ArrayList<HashMap<String, String>> doInBackground(String... params) {
                  try {
                    new DefaultHttpClient().execute(new HttpGet(URL))
                    .getEntity().writeTo(



                            new FileOutputStream(new File(PATH,"news.xml")));
                } catch (ClientProtocolException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                  File dir = Environment.getExternalStorageDirectory();
                  File yourFile = new File(dir, "/SCOUTS/news.xml");
                  FileInputStream stream = null;
                try {
                    stream = new FileInputStream(yourFile);
                } catch (FileNotFoundException e2) {
                    // TODO Auto-generated catch block
                    e2.printStackTrace();
                }
                  String jString = null;
                  try {
                      FileChannel fc = stream.getChannel();
                      MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
                      /* Instead of using default, pass in a decoder. */
                      jString = Charset.defaultCharset().decode(bb).toString();
                    } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                    finally {
                      try {
                        stream.close();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    }



                final ArrayList<HashMap<String, String>> libraryList = new ArrayList<HashMap<String, String>>();

                XMLParser parser = new XMLParser();
                String xml = jString;
                Document doc = parser.getDomElement(xml); 

                NodeList nl = doc.getElementsByTagName(KEY_ITEM);

                for (int i = 0; i < nl.getLength(); i++) {

                    HashMap<String, String> map = new HashMap<String, String>();
                    Element e = (Element) nl.item(i);


                    map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
                    map.put(KEY_DESCRIPTION, parser.getValue(e, KEY_DESCRIPTION));
                    map.put(KEY_LINK, parser.getValue(e, KEY_LINK));
                    map.put(KEY_PUB_DATE, parser.getValue(e, KEY_PUB_DATE));


                    libraryList.add(map);

            }
            return libraryList;}

          @Override
          protected void onPostExecute(ArrayList<HashMap<String, String>> result) {


                list=(ListView)findViewById(R.id.listView1);            
                adapter=new LazyAdapter(CustomizedListView.this, libraryList);        
                list.setAdapter(adapter);
                this.progressDialog.dismiss();

                list.setOnItemClickListener(new OnItemClickListener() {

                    public void onItemClick(AdapterView<?> parent, View view,
                            int position, long id) {
                          HashMap<String, String> map = libraryList.get(position);

                        Intent in = new Intent(CustomizedListView.this, org.scouts.android.news.Podcast.class);
                        in.putExtra(KEY_TITLE, map.get(KEY_TITLE));
                        in.putExtra(KEY_DESCRIPTION, map.get(KEY_DESCRIPTION));
                        in.putExtra(KEY_LINK, map.get(KEY_LINK));
                        in.putExtra(KEY_PUB_DATE, map.get(KEY_PUB_DATE));

                        startActivity(in);
                    }
                }); 



        ;}}}

I do not know what is causing it but if you can help, please do

  • 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-12T10:34:32+00:00Added an answer on June 12, 2026 at 10:34 am

    I was talking to the web dudes, this was a server side issue.

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

Sidebar

Related Questions

I have previously been told that I should always use Randomize() before I use
This is C#/.NET 2.0. So I have string that contains the future contents of
I have this little function function makewindows(){ child1 = window.open (about:blank); child1.document.write(<?php echo htmlspecialchars(json_encode($row2['ARTICLE_DESC']),
I have this problem where all URLs like context/path/file/anything/that/follows becomes context/path/file.php/anything/that/follows or context/path/file.xml/anything/that/follows .
This seems to be a fairly common problem, but the solutions that I have
I have a JQGrid that has a date column. I use the date formatter
It's a bit hard to word this but I have found that some websites
I have previously read Spolsky's article on character-encoding, as well as this from dive
Suppose that we have previously instantiated three objects A, B, C from class D
I believe this question might have been previously attempted in 2006 on a different

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.