Android version check

后端 未结 4 1262
渐次进展
渐次进展 2020-12-29 01:08

I\'m not new to Android and I\'m well used to the version handling and how to condition it, but when I see this it troubles me...

// Check if we\'re running          


        
4条回答
  •  情书的邮戳
    2020-12-29 01:23

    Bit a late to answer, but, today I encountered with the same issue on Android Studio 3.4.1

    So the workaround is:

    Upgrade to the latest Android SDK.

    And,

    After Marshmallow/Android 6 Build.VERSION_CODES.xxx full names are replaced with initials and some other variations.

    So, now for Marshmallow, it will be: Build.VERSION_CODES.M

    And for Nougat: Build.VERSION_CODES.N

    And so on.

    Read more about the build version codes here: Android Developer Reference

提交回复
热议问题