title: android ListView mListView.getChildAt(i) is null, how to solve it?
body: <p>I create the below code:   </p>
  
  <pre><code> mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position,
                  long id) {
  
              for (int i = 0; i &lt; mListView.getCount(); i++) {
                  View callLogView = mListView.getChildAt(i);   
                  mRelativeLayout = (LinearLayout)callLogView.findViewById(R.id.myShow);
                  if(i == position){
                      if(mRelativeLayout.getVisibility() == View.GONE){
                          mRelativeLayout.setVisibility(View.VISIBLE);
                      }
                      else{
                          mRelativeLayout.setVisibility(View.GONE);
                      }
                  }else{
                      mRelativeLayout.setVisibility(View.GONE);
                  }
              }
  
          }
      });
  </code></pre>
  
  <p>I want to realize a function like when i click one item of <code>Listview</code>, it will show a view, and the other items of Listview will be hidden. But <code>mListView.getChildAt(i)</code> will have the null pointer after exceed <code>mListView.getChildCount()</code>.</p>
  
  <p>How to solve this? Thanks in advance!</p>