ContextMenu shrinks when opened via JS Interface
<p>I am developing an android app. One of the activities works as follows: I display some HTML in a WebView and via Javascript detect a long touch with the following code:</p>

<pre><code>var touching = null;
$('.post').each(function() {
    this.addEventListener("touchstart", function(e) {
        window.clearTimeout(touching);
        touching = window.setTimeout(postLongTouch, 500, $(this).attr("id"));
    }, false);
    this.addEventListener("touchmove", function(e) {
        window.clearTimeout(touching);
    }, false);
    this.addEventListener("touchend", function(e) {
        window.clearTimeout(touching);
    }, false);
});

function postLongTouch(id) {
    window.JSInterface.showPostContextMenu(id);
}
</code></pre>

<p>I attached a JSInterface to the WebView with the function <code>showPostContextMenu(id)</code> in it. It looks as follows: </p>

<pre><code>    public void showPostContextMenu(String id) {
        mHandler.post(new Runnable() {
            public void run() {
                mHackerView.showContextMenu();
            }
        });

    }
</code></pre>

<p>Where <code>mHackerView</code> is some view on the activity and is registered for a context menu. I needed to add the Handler Stuff because this crashed since Android 4.1 due to, I suppose, the different Threads the WebView and the UI run in. </p>

<p>Now what happens is the following: When I touch a bit too long on the WebView, then the Context Menu is shown for a second but then shrinks to a white line. This does not happen, when I touch a little less long. The function <code>showPostContextMenu</code> is only called once, I checked that. It doesn't help calling <code>unregisterForContextMenu</code> for the view right after I opened the ContextMenu. </p>

<p>What causes this behaviour? Is it maybe again because of the different threads of the UI and the WebView? Is there any better way I could display a context menu and at the same time know information about the HTML element on which the user clicked? (This is the reason I use JS here...)</p>
