Calling API from higher API level than the minimum requirement

前端 未结 3 1449
清歌不尽
清歌不尽 2021-01-23 05:22

I wrote most of an app just fine with min API level set to 7. I want to call a single API from level 8. Users with lower versions of android will survive without this \"extra fe

3条回答
  •  有刺的猬
    2021-01-23 06:03

    It is better to wrap this around

    import android.os.Build;
    
    if(Build.VERSION.SDK_INT > Build.VERSION_CODES.ECLAIR_MR1) {
        // do what you want
    }
    

提交回复
热议问题