Android version check

后端 未结 4 1261
渐次进展
渐次进展 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:31

    Well in that case use this

    // Check if we're running on Android 5.0 or higher
    if (Build.VERSION.SDK_INT >= 21) {
        // Call some material design APIs here
    } else {
        // Implement this feature without material design
    }
    

    Build.VERSION_CODES.LOLLIPOP = 21

提交回复
热议问题