Pass MotionEvent between views
<p>I have a dialog window with <code>ImageView</code>. When I'm touching image <code>Dialog</code> is dismissed, but user still pressing the screen. Problem is that this touch event isn't passed to window below my <code>Dialog</code> (for example an <code>Activity</code>).</p>

<p>Can I somehow pass this <code>MotionEvent</code> (with <code>ACTION_DOWN</code>) to <code>Activity</code> so it still be able to generate new motion events (with <code>ACTION_MOVE</code> and <code>ACTION_UP</code> accordingly)?</p>

<p><strong>EDIT</strong></p>

<p>What I'm trying to do exactly in my <code>Activity</code>:</p>

<pre><code>//Sending touch event
MotionEvent ev = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis()+100, MotionEvent.ACTION_DOWN, 50, 50, 0);
getWindow().getDecorView().dispatchTouchEvent(ev);
</code></pre>

<p>and here is my <code>dispatchTouchEvent</code> and <code>onTouchEvent</code>:</p>

<pre><code>@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
    if(mDragging) {
        mMainFrame.onTouchEvent(ev); //I'm passing event to some view
        onTouchEvent(ev); //and then to my Activity
        return true;
    }

    return super.dispatchTouchEvent(ev);
}

public boolean onTouchEvent(MotionEvent ev) {
    return true;
}
</code></pre>
