title: Problem overriding getView()
body: <p>I keep getting an error when overriding my getview method. This is what I have:</p>
  
  <p>public class UnwatchedEpisodesActivity extends ListActivity{</p>
  
  <pre><code>private String[] values = new String[]{"Row 1", "Row 2", "Row 3"};
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.episode_main);
      setListAdapter(new EpisodeListAdapter());
  
  }
  
  private class EpisodeListAdapter extends ArrayAdapter&lt;String&gt;{
  
      private LayoutInflater li = LayoutInflater.from(this.getContext());
  
      public EpisodeListAdapter(){
          super(UnwatchedEpisodesActivity.this, 0, values);
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          if(convertView == null){
              convertView = li.inflate(R.layout.episode_row, parent, false);
          }
  
          ((TextView) convertView.findViewById(R.id.text1)).setText(values[position]);
          return convertView;
      }
  
  }
  </code></pre>
  
  <p>and my xml is this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout android:id="@+id/ep_layout"
      android:layout_width="fill_parent" android:layout_height="fill_parent"
      android:orientation="vertical"
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent" android:layout_height="wrap_content"
          android:id="@android:id/text1" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>(I also tried without the linearlayout, it makes no difference)
  I get <a href="http://i.stack.imgur.com/odFjE.png" rel="nofollow">this error.</a></p>
  
  <p>You guys any idea?</p>
  
  <p>Also another question:
  What should I do if I want to seperate the values in groups? I want a list to show something like:</p>
  
  <pre><code>-----------
  first part
  -----------
  Row 1
  Row 2
  -----------
  second part
  -----------
  Row 3
  </code></pre>
  
  <p>Obviously this is just an example; basically I want to know how to add those 'seperators'</p>