Change Status Bar color when entering Contextual Action Mode

    private int statusBarColor;

    @Override
    public boolean onCreateActionMode(ActionMode mode, Menu menu) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            //hold current color of status bar
            statusBarColor = getWindow().getStatusBarColor();
            //set your gray color
            getWindow().setStatusBarColor(0xFF555555);
        }
        ...
    }

    ...

    @Override
    public void onDestroyActionMode(ActionMode mode) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            //return to "old" color of status bar
            getWindow().setStatusBarColor(statusBarColor); 
        }
        ...
    }
});