Retrieving Android API version programmatically

前端 未结 11 2157
长情又很酷
长情又很酷 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:41

    Like this:

    String versionRelease = BuildConfig.VERSION_NAME;
    
    versionRelease :- 2.1.17
    

    Please make sure your import package is correct ( import package your_application_package_name, otherwise it will not work properly).

提交回复
热议问题