Java tutorial
//package com.java2s; import android.annotation.SuppressLint; import android.app.Activity; public class Main { @SuppressLint("NewApi") public static void setStatusBarColor(Activity mActivity, int color) { try { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { mActivity.getWindow().setStatusBarColor(color); } } catch (Exception e) { e.printStackTrace(); } } }