title: Android app to display title and description of the RSS feeds
body: <p>I am new to Android and I am trying to make an app to get the RSS feeds from a website that will display "title" and "description". But here, I am getting only the title not the description. In the XML part I have a listview where I get the title but not the description.</p>
  
  <pre><code>public class abcreaderextends ListActivity  {
      List&lt;String&gt; headlines;
      List&lt;String&gt; links;
      List&lt;String&gt; description;
  
  public InputStream getInputStream(URL url) {
     try {
         return url.openConnection().getInputStream();
     } catch (IOException e) {
         return null;
       }
  }
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_awsreader);
  
          // Initializing instance variables
          headlines = new ArrayList&lt;String&gt;();
          links = new ArrayList&lt;String&gt;();
          description= new ArrayList&lt;String&gt;();
  
  
          try {
              URL url = new URL("http://xxx.xxx.xxx/abc");
  
              XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
              factory.setNamespaceAware(false);
              XmlPullParser xpp = factory.newPullParser();
  
                  // We will get the XML from an input stream
              xpp.setInput(getInputStream(url), "UTF_8");
  
                 int i=0;
                boolean insideItem = false;
  
                  // Returns the type of current event: START_TAG, END_TAG, etc..
              int eventType = xpp.getEventType();
              while (eventType != XmlPullParser.END_DOCUMENT) {
  
                  i++;
  
  
  
                  //Log.i("Tag : ",xpp.getName().toString());
                  //Log.i("Text : ",xpp.nextText().toString());
  
                  if (eventType == XmlPullParser.START_TAG)
                  {
  
                      Log.i("Tag : ",xpp.getName().toString());
  
                      //Log.i("Text : ",xpp.nextText().toString());
  
                      if (xpp.getName().equalsIgnoreCase("item")) {
                          insideItem = true;
                      } 
  
                      else if (xpp.getName().equalsIgnoreCase("title")) {
                          if (insideItem)
                          {   
                              String var=xpp.nextText().toString();
  
                          headlines.add(var); //extract the description of article
                          Log.i("Title : ",var);      
                          //Log.i("Count : ",i+"");
                          }
                      } 
  
                      else if (xpp.getName().equalsIgnoreCase("description")) {
                          if (insideItem)
                          {   
                              String desc=xpp.nextText().toString();
  
                          description.add(desc); //extract the description of article
                          Log.i("Desc : ",desc);      
                          //Log.i("Count : ",i+"");
                          }
                      } 
  
  
  
  
                      else if (xpp.getName().equalsIgnoreCase("link")) {
                          if (insideItem)
                              links.add(xpp.nextText()); //extract the link of article
                      }
                  }else if(eventType==XmlPullParser.END_TAG &amp;&amp; xpp.getName().equalsIgnoreCase("item")){
                      insideItem=false;
  
                  }
  
  
  
  
                  eventType = xpp.next(); //move to next element
              }
  
          } catch (MalformedURLException e) {
              e.printStackTrace();
          } catch (XmlPullParserException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          // Binding data
      ArrayAdapter adapter = new ArrayAdapter(this,
                  android.R.layout.simple_list_item_1, description);
  
          setListAdapter(adapter);
  
  
          ArrayAdapter adaptr = new ArrayAdapter(this,
                  android.R.layout.simple_list_item_1, headlines);
  
          setListAdapter(adaptr);
  
  
      }
      @Override
      protected void onListItemClick(ListView l, View v, int position, long id) {
         Uri uri = Uri.parse((String) links.get(position));
         Intent intent = new Intent(Intent.ACTION_VIEW, uri);
         startActivity(intent);
      }
  
  
  }
  </code></pre>