Reparent a view in Android - move from one layout to another
<p>I'm coming from iOS where I can simply reparent a view under another view.  I'm trying to figure out the equiv in Android.  I want to move an imageview up a couple of spots in the view hierarchy when clicked.  Something like:</p>

<pre><code>public boolean onTouchEvent(MotionEvent event) {

    int action = event.getAction();

    //Tile touchBegan
    if(action == MotionEvent.ACTION_DOWN) {
        RelativeLayout rl = (RelativeLayout)(getParent().getParent());
        rl.addView(this);
    }
}
</code></pre>

<p>This is a simplified example of course.. but just trying to figure out how to re-parent a view under another layout.  I found this example searching around which seems incredibly complicated..  </p>

<p><a href="http://blahti.wordpress.com/2011/02/10/moving-views-part-3/" rel="nofollow">http://blahti.wordpress.com/2011/02/10/moving-views-part-3/</a></p>
