1if(android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.LOLLIPOP){
2 // Code For Android Version higher equal to LOLLIPOP(21)
3} else if(android.os.Build.VERSION.SDK_INT > 21){
4 // Code For Android Version higher than LOLLIPOP(21)
5} else{
6 // Code For Android Version lower than LOLLIPOP(21)
7}
8