You can use the external library StatusBarUtil:
Add to your module level build.gradle
:
compile 'com.jaeger.statusbarutil:library:1.4.0'
Then you can use the following util for an Activity to make the status bar transparent:
StatusBarUtil.setTransparent(Activity activity)
Example: