Android Settag () with Gettag (), with set multiple Settag ()

Source: Internet
Author: User

Settag is a Android of the View a useful method in a class,

In the same class, it is convenient to access data without building a database,

It also saves memory more than sharepreference.

Settag ( Object tag) method is relatively simple


Like what

TextView tvexecutor = (TextView) Findviewbyid (R.ID.T);

Tvexecutor.settag(selectedusermap);


This Selectedusermap

Can make map<string, string> selectedusermap this object.

It can also be the object of Linkedlist<carentity> mlist.

You can store a variety of temporary data, but you can't call it a storage method.

In the same class, we can use Settag (), Gettag (), to access the data.

Can one object, set multiple tags? The answer is yes.

Add in Res/values/strings.xml
<span face= "Consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dejavu Sans mono ', ' Bitstream Vera Sans Mon O ', ' Courier New ', monospace, serif "style=" Font-family:consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' De Javu Sans Mono ', ' bitstream Vera Sans mono ', ' Courier New ', monospace, serif; " ><span style= "LINE-HEIGHT:18PX;" ><span style= "color: #cc0000;" ><resources></span></span></span> 
<span style= "color: #cc0000;" ><span face= "Consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dejavu Sans mono ', ' Bitstream Vera Sans Mono ', ' Courier New ', monospace, serif "style=" Font-family:consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dejavu Sans mono ', ' bitstream Vera Sans mono ', ' Courier New ', monospace, serif; " ><item type= "id" name= "tag_a</span><span style=" Font-family:consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dejavu Sans mono ', ' bitstream Vera Sans mono ', ' Courier New ', monospace, serif; BACKGROUND-COLOR:RGB (240, 240, 240); " > "></ITEM></SPAN></SPAN> 
<span face= "Consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dejavu Sans mono ', ' Bitstream Vera Sans Mon O ', ' Courier New ', monospace, serif "style=" Font-family:consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' De Javu Sans Mono ', ' bitstream Vera Sans mono ', ' Courier New ', monospace, serif; " ><span style= "color: #cc0000;" ><item type= "id" name= "tag_b" ></ITEM></SPAN></SPAN> 
<span face= "Consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dejavu Sans mono ', ' Bitstream Vera Sans Mon O ', ' Courier New ', monospace, serif "style=" Font-family:consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' De Javu Sans Mono ', ' bitstream Vera Sans mono ', ' Courier New ', monospace, serif; " ><span style= "color: #cc0000;" ></resources></span></span> 
<span face= "Consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dejavu Sans mono ', ' bitstream Vera Sans Mono ' ', ' Courier New ', monospace, serif ' style= ' Font-family:consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dej Avu Sans Mono ', ' bitstream Vera Sans mono ', ' Courier New ', monospace, serif; " ></span>
In the activity, the use of the time to write
<span face= "Consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dejavu Sans mono ', ' Bitstream Vera Sans Mon O ', ' Courier New ', monospace, serif "style=" Font-family:consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' De Javu Sans Mono ', ' bitstream Vera Sans mono ', ' Courier New ', monospace, serif; " ></span> 
<code style= "border:0px; Vertical-align:baseline; Background-color:rgb (238, 238, 238);  Font-family:consolas, Menlo, Monaco, ' Lucida Console ', ' Liberation Mono ', ' Dejavu Sans mono ', ' bitstream Vera Sans Mono ', ' Courier New ', monospace, serif; padding:0px; margin:0px; " ><span style= "color: #cc0000;" ><span class= "PLN" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " ><span style= "font-family:arial; font-size:14px; line-height:26px; " >tvexecutor</span></span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >.</span><span class= "PLN" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >settag</span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " > (</span><span Class= "PLN" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >r</span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >.</span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " ><span color= "#00008b" >id.tag_a</span></span><span class= "pun" style= "border:0px"; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >,</span><span class= "PLN" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " > </span><span class= "str" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " > "Tease" </span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; Padding:0px; margin:0px; " >); </span><span class= "PLN" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " ><span style= "font-family:arial; font-size:14px; line-height:26px; " >tvexecutor</span></span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >.</span><span class= "PLN" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >settag</span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " > (</span><span class= "PLN" style= "border:0px; vertical-align:baseline; background-color:transparent; padding:0px; margin:0px; " >r</span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >.</span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " ><span color= "#00008b" >id.tag_b</span></span><span class= "pun" style= "border:0px"; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >,</span><span class= "PLN" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " > </span><span class= "str" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " > "2 goods" </span><span class= "pun" style= "border:0px; Vertical-align:baseline; Background-color:transparent; padding:0px; margin:0px; " >);</span></span></code>




Android Settag () with Gettag (), with set multiple Settag ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.