I am trying to implement tagging functionality in my app. When user enter 
"," then string before "," will be select as a tag and background color i 
need to assign this string(tag) so user can understand this is tag.
See following image.  

<https://lh5.googleusercontent.com/-clVP3IOy_z0/UrGDCaGuDJI/AAAAAAAABSI/_HzO5eO7fuo/s1600/tag_image1.png>

And after clicking backspace(Android soft keyboard button) then background 
color of the previous tag will change and if I click backspace again then 
previous tag will remove from EditText.

See following image.

<https://lh6.googleusercontent.com/-Rmt2_0r4HsA/UrGDiSwPrEI/AAAAAAAABSQ/ODswVa4QHzc/s1600/tag_image2.png>

Here what i done yet.

int i = 0;
names.addTextChangedListener(new TextWatcher() {
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int 
count) {
            if(s.equals(","))
            {
                String strTag = names.getText().toString();
                int txtLength = strTag.length()+3;
                 tagArrray[i] = strTag;
                 i++;
                 names.setText("#"+strTag+"  ");
                 names.setSelection(txtLength, txtLength);
            }
        }
        @Override
        public void afterTextChanged(Editable arg0) {
            // TODO Auto-generated method stub              
        }

        @Override
        public void beforeTextChanged(CharSequence arg0, int arg1,
                int arg2, int arg3) {
            // TODO Auto-generated method stub              
        }

        });   

*Where i stuck*

   - How to assign background to string(tag) which is in EditText(or border 
   to that string).
   - On clicking backspace change background color of last tag(may be i 
   have two tag like "android", "Droid" then it will change color of "Droid" 
   and clicking again backspace remove "Droid").

Please give me some hint or reference.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to