set Status Bar Translucent - Android android.app

Android examples for android.app:Status Bar

Description

set Status Bar Translucent

Demo Code


import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;

public class Main{

    public static void setStatusBarTranslucent(AppCompatActivity activity) {
        if (Build.VERSION.SDK_INT >= 21) {
            Window window = activity.getWindow();
            window.addFlags(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            window.setStatusBarColor(Color.TRANSPARENT);

        }/* w  w w.  j a  va2s. co m*/

    }

}

Related Tutorials