remove Activity Background Compat - Android Activity

Android examples for Activity:Activity Background

Description

remove Activity Background Compat

Demo Code


//package com.java2s;

import android.app.Activity;
import android.os.Build;

public class Main {
    public static void removeActivityBackgroundCompat(Activity activity) {
        if (activity == null) {
            throw new IllegalArgumentException("Activity is null");
        }/*from   ww  w.j  a  va2  s  . c  o  m*/

        if (Build.VERSION.SDK_INT >= 16) {
            activity.getWindow().getDecorView().setBackground(null);
        } else {
            activity.getWindow().getDecorView().setBackgroundDrawable(null);
        }
    }
}

Related Tutorials