privatebooleanperformFocusNavigation(KeyEventevent){...Viewfocused=mView.findFocus();if(focused!=null){Viewv=focused.focusSearch(direction);if(v!=null&&v!=focused){// Do the math to get the interesting rect// of previous focused into the coord system of// newly focused viewfocused.getFocusedRect(mTempRect);if(mViewinstanceofViewGroup){((ViewGroup)mView).offsetDescendantRectToMyCoords(focused,mTempRect);((ViewGroup)mView).offsetRectIntoDescendantCoords(v,mTempRect);}if(v.requestFocus(direction,mTempRect)){booleanisFastScrolling=event.getRepeatCount()>0;playSoundEffect(SoundEffectConstants.getConstantForFocusDirection(direction,isFastScrolling));returntrue;}}// Give the focused view a last chance to handle the dpad key.if(mView.dispatchUnhandledMove(focused,direction)){returntrue;}}else{if(mView.restoreDefaultFocus()){returntrue;}}...}