Code example for View

Methods: postInvalidate

0
     */ 
    public static void postInvalidateOnAnimation(View view) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            view.postInvalidateOnAnimation();
        } else { 
            view.postInvalidate();
        } 
    } 
 
    // These methods have a new name, and the old name is deprecated. 
 
    /** 
     * @see android.view.View#setBackground(Drawable) 
     */ 
    @SuppressWarnings("deprecation") 
    public static void setBackgroundForView(View view, Drawable drawable) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            view.setBackground(drawable);
        } else { 
            view.setBackgroundDrawable(drawable);
Contextual code suggestions in your IDE  Get Codota for Java