Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * Licensed Materials - Property of IBM
 *  Copyright IBM Corporation 2014, 2015. All Rights Reserved.
 */

import android.annotation.TargetApi;

import android.os.Build;

import android.view.Window;

public class Main {
    /**
     * Changes the status bar color. This only works on API 21+.
     *
     * @param window The window of the Activity
     * @param color The desired color (resource ID) for the status bar
     */
    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public static void statusBarColor(Window window, int color) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            window.setStatusBarColor(color);
        }
    }
}