title: cannot remove specific views in android
body: <p>I have a problem in removing views.</p>
  
  <pre><code>     ViewGroup owner = (ViewGroup) lastImageSelected.getParent();
  
                  int x = owner.getChildCount();
                  for(int i=0; i&lt;=x; i++) {
                      View currentChild = owner.getChildAt(i);
                      if (currentChild != mainImage &amp;&amp; currentChild != zoomIn 
                              &amp;&amp; currentChild != zoomOut &amp;&amp; currentChild != rotatePoint) {
                          owner.removeView(currentChild);
                          owner.invalidate();
                      }
                  }
  </code></pre>
  
  <p>This code is working, but everytime I delete, all views are not deleting. I think all odd numbers(index) is not deleting.</p>