According to the official documentation :

You can use Android 5.0 APIs while also supporting older versions by adding 
> conditions to your code that check for the system API level before 
> executing APIs not supported by your minSdkVersion 
> <https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#min>.
>  
> To learn more about maintaining backward compatibility, read Supporting 
> Different Platform Versions 
> <https://developer.android.com/training/basics/supporting-devices/platforms.html>
> .


Example with honeycomb : 

// Make sure we're running on Honeycomb or higher to use ActionBar APIs
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        ActionBar actionBar = getActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);         } 


In your case : 

if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to