title: Imageview in custom listview not changing according to conditons
body: <p>So i'm creating a custom listview populated by data from an rss feed about what the predicted weather will be. In this lsitview I want there to be an image which matches with what the weather is described to be like, a sun icon for sunny weather rain icon for rainy weather etc. I set up if conditions in my adapter class and when the word sun is mentioned it sets up a sun icon but none of the other conditions work</p>
  <p>here is my customadapter class</p>
  <pre><code>package org.me.gcu.labstuff.bbctest2;
  
  import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.BaseAdapter;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import java.util.ArrayList;
  
  public class CustomBaseAdapter extends BaseAdapter {
      Context context;
      ArrayList&lt;RSSItem&gt; rssList;
      LayoutInflater inflater;
  
      public CustomBaseAdapter (Context ctx, ArrayList&lt;RSSItem&gt; rssItemList){
  this.context=ctx;
  this.rssList=rssItemList;
  inflater=LayoutInflater.from(ctx);
      }
      @Override
      public int getCount() {
          return rssList.size();
      }
  
      @Override
      public Object getItem(int i) {
          return rssList.get(i);
      }
  
      @Override
      public long getItemId(int i) {
          return i;
      }
  
      @Override
      public View getView(int i, View convertView, ViewGroup parent) {
       if(convertView == null) {
           convertView = LayoutInflater.from(context).inflate(R.layout.row, parent, false);
       }
           RSSItem tempRSSItem=(RSSItem) getItem(i);
  
          ImageView img = (ImageView) convertView.findViewById(R.id.wthrIcon);
           TextView tvTitle=(TextView) convertView.findViewById(R.id.titletxt);
           TextView tvDesc=(TextView) convertView.findViewById(R.id.desctxt);
           TextView tvDate=(TextView) convertView.findViewById(R.id.datetxt);
  
  
  if(tempRSSItem.getTitle().contains(&quot;Sunny&quot;)) {
      img.setBackgroundResource(R.drawable.day_clear);
  }
  if (tempRSSItem.getTitle().contains(&quot;rain&quot;)) {
              img.setBackgroundResource(R.drawable.day_rain);
          }
  
   if (tempRSSItem.getTitle().contains(&quot;cloudy&quot;)){
      img.setBackgroundResource(R.drawable.cloudy);
  }
           tvTitle.setText(tempRSSItem.getTitle());
           tvDesc.setText(tempRSSItem.getDesc());
           tvDate.setText(tempRSSItem.getPubDate());
  
  
           return convertView;
  
  
  
  
  
  
      }
  }
  
  </code></pre>
  <p>my class for opening the rss url and parsing it</p>
  <pre><code>package org.me.gcu.labstuff.bbctest2;
  
  import android.util.Log;
  import android.widget.ArrayAdapter;
  
  import org.xmlpull.v1.XmlPullParser;
  import org.xmlpull.v1.XmlPullParserException;
  import org.xmlpull.v1.XmlPullParserFactory;
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.net.MalformedURLException;
  import java.net.URL;
  import java.net.URLConnection;
  import java.sql.DatabaseMetaData;
  import java.text.DateFormat;
  import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.ArrayList;
  import java.util.Date;
  import java.util.Locale;
  
  public class RSSHelper {
  
  
      private static Exception exception=null;
  
      public static InputStream getInputStream(URL url) {
          try {
              return url.openConnection().getInputStream();
          } catch (IOException e) {
              return null;
          }
      }
  
      public static String showLink(String link){
          System.out.println(link);
          return link;
      }
  
      public static String getRawData(String url){
          URL aurl;
          URLConnection yc;
          BufferedReader in = null;
          String inputLine = &quot;&quot;;
          String result=null;
  
  
          Log.e(&quot;MyTag&quot;,&quot;in run&quot;);
  
          try
          {
              Log.e(&quot;MyTag&quot;,&quot;in try&quot;);
              aurl = new URL(url);
              yc = aurl.openConnection();
              in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
              Log.e(&quot;MyTag&quot;,&quot;after ready&quot;);
              //
              // Now read the data. Make sure that there are no specific hedrs
              // in the data file that you need to ignore.
              // The useful data that you need is in each of the item entries
              //
              while ((inputLine = in.readLine()) != null)
              {
                  result = result + inputLine;
                  Log.e(&quot;MyTag&quot;,inputLine);
  
              }
              in.close();
          }
          catch (IOException ae)
          {
              Log.e(&quot;MyTag&quot;, &quot;ioexception in run&quot;);
          }
          return result;
      }
      public static ArrayList&lt;RSSItem&gt; parseRSS(String link){
          ArrayList&lt;RSSItem&gt; rssItemList = new ArrayList&lt;&gt;();
  
          String rssTitle = &quot;&quot;;
          String rssDesc = &quot;&quot;;
          String rssDate=&quot;&quot;;
  
          try {
  
              URL url= new URL(link);
              XmlPullParserFactory factory= XmlPullParserFactory.newInstance();
              factory.setNamespaceAware(true);
              XmlPullParser xpp = factory.newPullParser();
  
              xpp.setInput(getInputStream(url),&quot;UTF_8&quot;);
              boolean insideItem = false;
  
              int eventType = xpp.getEventType();
              while(eventType!= XmlPullParser.END_DOCUMENT){
                  if(eventType== XmlPullParser.START_TAG){
                      if(xpp.getName().equalsIgnoreCase(&quot;item&quot;)) {
                          insideItem = true;
  
                      }
  
                          if (xpp.getName().equalsIgnoreCase(&quot;title&quot;) &amp;&amp; insideItem) {
  
                              rssTitle = xpp.nextText();
  
  
                              Log.d(&quot;MyTag&quot;, &quot;title is &quot; + rssTitle);
  
                          }
                          if (xpp.getName().equalsIgnoreCase(&quot;description&quot;) &amp;&amp; insideItem) {
                              rssDesc = xpp.nextText();
                              Log.d(&quot;MyTag&quot;, &quot;desc is &quot; + rssDesc);
  
                          }
                          if (xpp.getName().equalsIgnoreCase(&quot;pubDate&quot;) &amp;&amp; insideItem) {
                              rssDate = xpp.nextText();
                              Log.d(&quot;MyTag&quot;, &quot;date is &quot; + rssDate);
  
                              RSSItem rssItem = new RSSItem(rssTitle,rssDesc,rssDate);
                              rssItemList.add(rssItem);
  
                          }
  
  
                  }else if(eventType==XmlPullParser.END_TAG &amp;&amp; xpp.getName().equalsIgnoreCase(&quot;item&quot;)){
                      insideItem=false;
  
  
                  }
                  eventType= xpp.next();
              }
  
          }catch (MalformedURLException e){
              exception=e;
          }
          catch (XmlPullParserException e){
              exception=e;
          } catch (IOException e) {
              exception=e;
              e.printStackTrace();
          }
  
          return rssItemList;
  
      }
  
  
  }
  </code></pre>
  <p>and the xml for each row of the listview</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:orientation=&quot;horizontal&quot;&gt;
  
      &lt;ImageView
          android:id=&quot;@+id/wthrIcon&quot;
          android:layout_width=&quot;50dp&quot;
          android:layout_height=&quot;64dp&quot; /&gt;
  
  
      &lt;LinearLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;fill_parent&quot;
          android:orientation=&quot;vertical&quot;&gt;
  
  
          &lt;TextView
              android:id=&quot;@+id/titletxt&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:text=&quot;Title&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/desctxt&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:text=&quot;Desc&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/datetxt&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:text=&quot;Date&quot; /&gt;
  
  
  
  
      &lt;/LinearLayout&gt;
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>right now this is what i get on my emulator</p>
  <p><a href="https://freeimage.host/i/govgnI" rel="nofollow noreferrer">https://freeimage.host/i/govgnI</a></p>
  <p>Any help is greatly appreciated thanks</p>