<tfoot id='I3Ktx'></tfoot>

    • <bdo id='I3Ktx'></bdo><ul id='I3Ktx'></ul>
  1. <i id='I3Ktx'><tr id='I3Ktx'><dt id='I3Ktx'><q id='I3Ktx'><span id='I3Ktx'><b id='I3Ktx'><form id='I3Ktx'><ins id='I3Ktx'></ins><ul id='I3Ktx'></ul><sub id='I3Ktx'></sub></form><legend id='I3Ktx'></legend><bdo id='I3Ktx'><pre id='I3Ktx'><center id='I3Ktx'></center></pre></bdo></b><th id='I3Ktx'></th></span></q></dt></tr></i><div id='I3Ktx'><tfoot id='I3Ktx'></tfoot><dl id='I3Ktx'><fieldset id='I3Ktx'></fieldset></dl></div>
    <legend id='I3Ktx'><style id='I3Ktx'><dir id='I3Ktx'><q id='I3Ktx'></q></dir></style></legend>

      <small id='I3Ktx'></small><noframes id='I3Ktx'>

    1. 获取对象标签的字符串

      时间:2023-09-10
            <tfoot id='oS9dr'></tfoot>

              <bdo id='oS9dr'></bdo><ul id='oS9dr'></ul>
                  <tbody id='oS9dr'></tbody>
              • <legend id='oS9dr'><style id='oS9dr'><dir id='oS9dr'><q id='oS9dr'></q></dir></style></legend>

                <small id='oS9dr'></small><noframes id='oS9dr'>

              • <i id='oS9dr'><tr id='oS9dr'><dt id='oS9dr'><q id='oS9dr'><span id='oS9dr'><b id='oS9dr'><form id='oS9dr'><ins id='oS9dr'></ins><ul id='oS9dr'></ul><sub id='oS9dr'></sub></form><legend id='oS9dr'></legend><bdo id='oS9dr'><pre id='oS9dr'><center id='oS9dr'></center></pre></bdo></b><th id='oS9dr'></th></span></q></dt></tr></i><div id='oS9dr'><tfoot id='oS9dr'></tfoot><dl id='oS9dr'><fieldset id='oS9dr'></fieldset></dl></div>

              • 本文介绍了获取对象标签的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我对标签有疑问.例如,如果我有一个带有标签ButtonTag"的按钮.标签是一个对象,但我想捕获一个字符串ButtonTag"并在开关内使用.总结一下,得到一个对象标签字符串并在开关中使用.有可能吗?

                I have a doubt related with tag. For example, if i have a button with a tag "ButtonTag". Tag is a object, but i would like to catch a string "ButtonTag" and use inside a switch. Summing up, to get a String of Object tag and to use in a Switch. Is possible ?

                public void ArtGeneralButton(View view){
                         selsub = view.getId();
                         tagsub = view.getTag(); \ Object -> String How???
                        // String myString = getString(null,tagsub,);
                         UpdateAnsList myUpdate = new UpdateAnsList(this);      
                         myUpdate.StartUpdateAnsList(selsub,tagsub);
                
                    }
                

                推荐答案

                String tagString = (String) view.getTag();
                

                只要最初用于设置标签的内容是 String

                It's as simple as that as long as whatever was originally used to set the tag was a String

                至于在 switch 中使用 String 而言,我更喜欢使用 int 作为 switch<的键/代码>.在这种情况下,我会将标签设置为 ints - 可以是任意值,例如 1、2、3 等,也可以使用 strings.xml 文件中字符串的资源 ID.

                As for using a String in a switch is concerned, I prefer to use int as the key for a switch. In this case I'd set the tags as ints - either arbitrary values such as 1, 2, 3 etc or use the resource ids of strings in the strings.xml file.

                这篇关于获取对象标签的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  • <bdo id='n5kuz'></bdo><ul id='n5kuz'></ul>

                      <tbody id='n5kuz'></tbody>
                      <legend id='n5kuz'><style id='n5kuz'><dir id='n5kuz'><q id='n5kuz'></q></dir></style></legend>
                      1. <tfoot id='n5kuz'></tfoot>
                        <i id='n5kuz'><tr id='n5kuz'><dt id='n5kuz'><q id='n5kuz'><span id='n5kuz'><b id='n5kuz'><form id='n5kuz'><ins id='n5kuz'></ins><ul id='n5kuz'></ul><sub id='n5kuz'></sub></form><legend id='n5kuz'></legend><bdo id='n5kuz'><pre id='n5kuz'><center id='n5kuz'></center></pre></bdo></b><th id='n5kuz'></th></span></q></dt></tr></i><div id='n5kuz'><tfoot id='n5kuz'></tfoot><dl id='n5kuz'><fieldset id='n5kuz'></fieldset></dl></div>
                      2. <small id='n5kuz'></small><noframes id='n5kuz'>