Code example for ImageView

Methods: setAlpha, invalidateDrawable

0
                mWarningIconView.setAlpha(255); 
                if (!mStopAnimation) { 
                    mAnimationHandler.sendEmptyMessageDelayed(0, WARNING_ICON_ON_DURATION_MSEC); 
                } 
            } else { 
                mWarningIconView.setAlpha(0); 
                if (!mStopAnimation) { 
                    mAnimationHandler.sendEmptyMessageDelayed(0, WARNING_ICON_OFF_DURATION_MSEC); 
                } 
            } 
            mIconAnimationState = !mIconAnimationState; 
            mWarningIconView.invalidateDrawable(mWarningIcon); 
        } 
    }; 
 
    /** 
     * Create a new alert dialog for the broadcast notification. 
     * @param context the local Context 
     * @param titleId the resource ID of the dialog title 
     * @param body the message body contents 
     * @param showWarningIcon true if the flashing warning icon should be shown