Code example for ImageButton

Methods: requestFocus, setEnabled

0
            return; 
        } 
         
        try { 
            if (mPauseButton != null && !mPlayer.canPause()) {
                mPauseButton.setEnabled(false);
            } 
            if (mRewButton != null && !mPlayer.canSeekBackward()) {
                mRewButton.setEnabled(false);
            } 
            if (mFfwdButton != null && !mPlayer.canSeekForward()) {
                mFfwdButton.setEnabled(false);
            } 
        } catch (IncompatibleClassChangeError ex) {
            // We were given an old version of the interface, that doesn't have 
            // the canPause/canSeekXYZ methods. This is OK, it just means we 
            // assume the media can be paused and seeked, and so we don't disable 
            // the buttons. 
        } 
    } 
     
    /** 
     * Show the controller on screen. It will go away 
     * automatically after 'timeout' milliseconds of inactivity. 
     * @param timeout The timeout in milliseconds. Use 0 to show 
     * the controller until hide() is called. 
     */ 
    public void show(int timeout) {
        if (!mShowing && mAnchor != null) {
            setProgress(); 
            if (mPauseButton != null) {
                mPauseButton.requestFocus();
            } 
            disableUnsupportedButtons(); 
 
            FrameLayout.LayoutParams tlp = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,