简体   繁体   中英

<Tag> is not supported in Kitkat version

I'm using <tag> for View in Android. I tried to add multiple tags for Button.

    <Button
            android:id="@+id/button"
            android:layout_width="368dp"
            android:layout_height="wrap_content"
            android:text="CLOSE" >
            <tag
                android:id="@+id/close_one"
                android:value="@string/close_one_string" />
            <tag
                android:id="@+id/close_two"
                android:value="@string/close_two_string" />
   </Button>

I executed my application in Kitkat tablet and Marshmallow tablet. In marshmallow it works fine. But In kitkat it doesn't run.

So, I searched on internet related to this topic. In stackoverflow I found one answer that <tag> is supported above API level 21. Click Here

After that I refereed Android documentation where I found, it supports from API level 4. Click Here

My question is how to give support for <tag> in Kitkat?

The tag you are referring to in the documentation is when you call it from code. The xml <tag> is only avaivable on API 21+

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM