Detect long press on "virtual" back-key
<p>havent found a solution yet.
I want to detect a long press on the "virtual" back-key, the one you find at the galaxy s2 for example.</p>

<p>I tried to detect the onKeyDown-events (which works) when the user presses the button and the onKeyUp-events when the user leaves the button but the virtual key is firing onKeyUp-events all the time.</p>

<p>I also tried to override the onKeyLongPress-method but this havent helped.</p>

<pre><code> @Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
    if (keyCode == KeyEvent.KEYCODE_BACK)
    {
        mBackKeyDownTime = event.getEventTime();
        return true;
    }
    return super.onKeyDown(keyCode, event);
}

@Override
public boolean onKeyUp(int keyCode, KeyEvent event)
{
    if(keyCode == KeyEvent.KEYCODE_BACK)
    {
        mBackKeyUpTime = event.getEventTime();
        final long delta = mBackKeyUpTime - mBackKeyDownTime;
        return true;
    }
    return super.onKeyUp(keyCode, event);
}
</code></pre>
