i am trying to get a very basic rss reader to work but am running into problems. I have searched the internet for tutorials but have struggled to find anything that works (maybe i'm doing something wrong but i always seem to get countless errors when i follow tutorials that apparently work for others, even if i copy and paste). I have found a couple of solutions which when i've combined the two have gotten me closer (i think) to getting a working app than i've been in the past in the sense that the app code doesn't contain any errors that stop it from compiling and the app doesn't crash when i run it on my nexus 5, it just leaves the textview empty. i've tried loading up an emulator but my computer doesn't like loading them and it rarely works so i can't test the app on one at the moment.

The tutorials i have followed have both used the xmlpullparser which i have also seen is the recommended option from the android developers website. I have added the internet permission to the android manifest (i made that omission in the past and took days to figure out what was going wrong).

my code is as follows:
Code:
package com.kpwebs.rsstest;

import android.os.AsyncTask;
import android.support.v7.app.ActionBarActivity;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

public class MainActivity extends ActionBarActivity {

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

        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, new PlaceholderFragment())
                    .commit();

            asyncDownloader d = new asyncDownloader();
            d.execute();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    public static class PlaceholderFragment extends Fragment {

        public PlaceholderFragment() {
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
            View rootView = inflater.inflate(R.layout.fragment_main, container, false);
            return rootView;
        }
    }

    private class asyncDownloader extends AsyncTask<Object, String, Integer> {

        @Override
        protected Integer doInBackground(Object... objects) {
            XmlPullParser receivedData = tryDownloadingXMLData();
            int recordsFound = tryParsingXMLData(receivedData);
            return recordsFound;
        }

        @Override
        protected void onProgressUpdate(String... values){
            TextView tv2 = (TextView)findViewById(R.id.text);
            tv2.setText(values.toString());

            if (values.length > 0){
                String title = values[0];
                handleNewRecord(title);
            }
            super.onProgressUpdate(values);
        }

        private int tryParsingXMLData(XmlPullParser receivedData) {
            if (receivedData != null) {
                try {
                    return processReceivedData(receivedData);
                } catch (XmlPullParserException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return 0;
        }

        private int processReceivedData(XmlPullParser xpp) throws IOException, XmlPullParserException {
            xpp.nextTag();
            xpp.require(XmlPullParser.START_TAG, null, "channel");
            while (xpp.nextTag() == XmlPullParser.START_TAG) {
                xpp.require(XmlPullParser.START_TAG, null, "item");

                xpp.nextTag();
                xpp.require(XmlPullParser.START_TAG, null, "title");
                String title = xpp.nextText();
                xpp.require(XmlPullParser.END_TAG, null, "title");

                xpp.nextTag();
                xpp.require(XmlPullParser.END_TAG, null, "item");
                publishProgress(title);
            }
            xpp.require(XmlPullParser.END_TAG, null, "channel");
            publishProgress();
            return 0;
        }

        private XmlPullParser tryDownloadingXMLData() {
            try {
                XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
                factory.setNamespaceAware(true);
                XmlPullParser xpp = factory.newPullParser();

                URL input = new URL("http://feeds.bbci.co.uk/sport/0/rugby-league/rss.xml?edition=uk");
                xpp.setInput(input.openStream(), null);
                Log.i("", xpp.toString());
                return xpp;
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (XmlPullParserException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }
    }

    private void handleNewRecord(String title) {
        TextView tv = (TextView)findViewById(R.id.text);
        String message = tv.getText().toString() + "\n" + title;
        tv.setText(message);
    }

}
this might well not be the best way of doing this sort of thing, but i've had to merge together 2 methods in order to get this far so my main priority is simply getting it to work.

does anybody have any suggestions on what i'm doing wrong?

thank you