Sunday, January 8, 2012

onKeyDown/onKeyUp/onTrackballEvent does not fire in a View

When trying to get keypad events in a view, the view does not get those events unless explicitly sent by the Activity, so to fix this add the following code in the Activity:

@Override
public boolean onTrackballEvent(MotionEvent event) {
if (mView.dispatchTrackballEvent(event) == true)
return true;

return super.onTrackballEvent(event);
}

No comments: