Using attributes from API level beyond minSdkVersion

前端 未结 3 1802
心在旅途
心在旅途 2021-02-05 01:18

I am new to Android development and am wondering what happens if you use attributes on XML tags from an API level greater than your minSdkVersion.

For example having:

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 02:06

    In this case, the manipulation of attributes that are different APIs must be made via code and not in XML.

    In code, you can treat it.

    For example:

     if(Build.Version.SDK_INT > 10){
    
         .... use an attribute
    
       }
    else{
    
        .... use other
    }
    

    For your specific case, use "icon"

    
    

提交回复
热议问题