title: NullPointerException when using listview within tabs
body: <p>I'm trying to implement a listview within a tab. There i'm using a custom arrayadapter to create a custom listview. Code is as follows.</p>
  
  <p>Creating the tab activity :</p>
  
  <pre><code>TabHost th = getTabHost();
  TabSpec specGroups = th.newTabSpec("Groups");
      specGroups.setIndicator("Groups");
      Intent intentGroups = new Intent(this, GroupsList.class);
      specGroups.setContent(intentGroups);
  </code></pre>
  
  <p>Grouplist activity :</p>
  
  <pre><code>public class GroupsList extends Activity {
  
  public String[] ROSTER_LIST = {"Sam", "Bob", "Tabg", "Toushi", "john"};
  private ListView ROSTER_LISTVIEW;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.groups_list);
  
      Log.d("STARTED", "0");
  
      ROSTER_LISTVIEW = (ListView) findViewById(R.id.listViewFriends);
      Log.d("STARTED", "1");
  
      ArrayAdapter&lt;String&gt; adapter = new MyAdapter(this,
              android.R.layout.simple_list_item_1, R.id.textViewRosterRow,
              ROSTER_LIST);
      Log.d("STARTED", "2");
  
      ROSTER_LISTVIEW.setAdapter(adapter);
      Log.d("STARTED", "3");
  
  }
  </code></pre>
  
  <p>Custom Adapter Class (inner class) :</p>
  
  <pre><code>private class MyAdapter extends ArrayAdapter&lt;String&gt; {
  
      public MyAdapter(Context context, int resource, int textViewResourceId,
              String[] ROSTER_LIST) {
          super(context, resource, textViewResourceId, ROSTER_LIST);
          // TODO Auto-generated constructor stub
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
          LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          Log.d("ADAPTER", "0");
          View row = inflater
                  .inflate(R.layout.friends_list_row, parent, false);
          Log.d("ADAPTER", "1");
  
          TextView text = (TextView) row.findViewById(R.id.textViewRosterRow);
          Log.d("ADAPTER", "2");
          text.setText(ROSTER_LIST[position]);
  
          Log.d("ADAPTER", "OK");
          return row;
      }
  
  }
  </code></pre>
  
  <p>inside the oncreate method <code>Log.d("STARTED", "2");</code> line logs in the logcat and then pops sthe nullpointerexception. no <code>Log</code> logs in the logcat which is inside the <code>MyAdapter</code> inner class. </p>
  
  <blockquote>
    <p>This code executes fine without the tabs.</p>
  </blockquote>
  
  <p>what is the mistake i have made here? How can I solve this? thanks in advance :)</p>