1

I want to perform spanning on MultiAutoCompleteTextView in my android application. For that i have referred Splitwise TokenAutoComplete project and its working properly. They have created custom MultiAutoCompleteTextView for entering email id.here, whenever i select any item from dropdown, its added to custom token class. I want to fetch the entire content of that MultiAutoCompleteTextView, whether it is spannable text or simple text. For that if i write getText().toString(), it discards all spanned values and just return simple text without span. I want to get entire string written in this MultiAutoCompleteTextView along with spannables. If any one have used this control in their application or have any idea regarding this then please help me solve this issue. Thank you

Example :

Entered text : "@Marshall Wire and @Amanda"

Output of getText().toString : "@ and @" (marshall wire and Amanda are spanned objects which are discarded)

Zankhna
  • 4,570
  • 9
  • 62
  • 103
  • Do you happen to have some sample code for this issue? I'm trying to figure out for the splitwise/TokenAutoComplete library to allow for some text to be tokenized, while other text not, e.g., "Hi this is @[some token text], and here is another @[tokenized text]." Can't seem to find a straight-forward answer anywhere. – user1301593 Oct 24 '16 at 21:40

1 Answers1

0

The simplest way to do this is to just use the output of getText() and replace the instances of @ with the objects from getObjects in order (though I would expect @@ instead of @ given how I implemented this...).

Marshall Weir
  • 463
  • 5
  • 10