Possible to only load specific lines of code according to Android OS version?

后端 未结 4 1320
南方客
南方客 2020-12-28 23:33

Is there a simple line of code that would allow only loading the code if the OS version meets the requirements?

Lets say I have my target OS as 2.2 but the min sdk

4条回答
  •  别那么骄傲
    2020-12-29 00:06

    You can check with Build.VERSION.RELEASE, it gives you the current version of your android system (1.5,1.6,2.1,2.2)

    There is more on Build.VERSION

提交回复
热议问题