title: Android - Removing an ImageView from a RelativeLayout
body: <p>How can I remove an ImageView from a RelativeLayout? For some reason <code>RelativeLayout.removeView(iv);</code> doesn't work. I'm creating the ImageView programmatically like this: </p>
  
  <p><code>final ImageView iv = new ImageView(MainActivity.this);</code> But this doesn't work. </p>
  
  <p>I don't want to use <code>iv.setVisibility(View.GONE);</code> because this doesn't really remove the image, it just sets the visibility.</p>
  
  <p>Why isn't this working? Is there any alternative?</p>