Trying to move an ImageView in a touch event via setLayoutParams, imageview is not moving
<p>I've got a small ImageView inside of a fullscreen FrameLayout, and I'd like to set it such that when I touch the FrameLayout, the imageview moves to that position. </p>

<p>I've read all the other SO questions I can find about moving ImageView but I haven't seen why my solution is not working yet. </p>

<p>In a custom view which extends FrameLayout:</p>

<pre><code>@Override
public boolean onInterceptTouchEvent(MotionEvent event){

    if(event.getActionMasked() == MotionEvent.ACTION_DOWN){
        ImageView iv = (ImageView) this.findViewById(R.id.draggedImage);
        FrameLayout.LayoutParams params = (LayoutParams) iv.getLayoutParams();
        params.leftMargin = (int) event.getX();
        params.bottomMargin = (int) event.getY();
        iv.setLayoutParams(params);
        iv.invalidate();
        invalidate();           
    }
    return true;
}
</code></pre>

<p>I've changed the layoutparams margin to reflect the new touch position, and invalidated the imageview and framelayout (not sure which of these I should be doing), but the imageView doesn't budge (just sits always in the top left corner of the frame). </p>

<p>I've also verified that this method is being called when I touch the screen and the params is getting set with sane X and Y values.</p>

<p>My layout:</p>

<pre><code>&lt;CustomFrameLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" &gt;

    &lt;!-- some other unrelated views --&gt;

    &lt;ImageView
        android:id="@+id/draggedImage"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:src="@drawable/pause" /&gt;    

&lt;/CustomFrameLayout&gt;
</code></pre>

<p>Edit:
Should have mentioned that I'm trying to target API level 10, so I can't use any of the Honeycomb view orientation goodness :(</p>
