title: how to make some items of a listview non clickable?
body: <p>I have following code which is quite easy to understand. I want some specific child of this listview to be non clickable.</p>
  
  <pre><code>    ArrayAdapter&lt;String&gt; adapter =
        new ArrayAdapter&lt;String&gt;(this,R.layout.list_item,R.id.module_name_item, testdata);
  
      m_listview.setAdapter(adapter);
  
  
      Log.i("check","1");
      if(sectionAttempts.get(0).equals("0"))
      {
  
          m_listview.getChildAt(2).setEnabled(false);
          m_listview.getChildAt(3).setEnabled(false);
      }
      else
      {
  
          if(sectionAttempts.get(2).equals("0"))
          {
  
              m_listview.getChildAt(3).setEnabled(false);
          }
  
  
      }
  </code></pre>
  
  <p>I am getting error in  </p>
  
  <pre><code>  m_listview.getChildAt(2).setEnabled(false);
  </code></pre>
  
  <p>as java.lang.NullpointerException. I tried to find the error and used Log.i("check",m_listview.getChildCount()); And it show 0. so i am guessing the listview hasnt beent created yet!! How is that possible. </p>
  
  <p>What seems to be the problem? Thanx for any help in advance.</p>