Retrieving Android API version programmatically

前端 未结 11 1884
长情又很酷
长情又很酷 2020-11-22 04:54

Is there any way to get the API version that the phone is currently running?

11条回答
  •  粉色の甜心
    2020-11-22 05:30

    try this:

     if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
         // only for gingerbread and newer versions
     }
    

提交回复
热议问题