title: Android AutoCompleteTextView with '@' mentions filtering like twitter and facebook
body: <p>I have a requirement for implementing an edit text that the user can type in a anything but when they type in a new word that starts with '@' the autocomplete should start showing potential users.</p>
  
  <p>I understand how to use the AutoCompleteTextView function for filtering. But I am not sure how to go about capturing the characters from the last word after the '@' symbol (ignoring any previous words).</p>
  
  <p>Consequently when the user has been selected from the AutoCompleteTextView list, it should replace the the word with '@', eg.</p>
  
  <hr>
  
  <p><em>"This is a message for @steve"</em></p>
  
  <hr>
  
  <p>when the user clicks on "Steve" from the list, the text should replace to:</p>
  
  <hr>
  
  <p><em>"This is a message for <strong>Steve</strong>"</em></p>
  
  <hr>
  
  <p>I also need to obtain the string in a form that I can send off to the server. i.e. from the above example I would need to send off the string:</p>
  
  <hr>
  
  <p><em>"This is a message for [username:steve@bloggs.com, id:44]."</em></p>
  
  <hr>
  
  <p>I have looked at <a href="https://github.com/splitwise/TokenAutoComplete" rel="noreferrer">https://github.com/splitwise/TokenAutoComplete</a></p>
  
  <p>Which seems great for typing emails in a list, but I am not sure how to cater it for my needs. Bare in mind, I need to support multiple/duplicate mentions:</p>
  
  <p>eg</p>
  
  <hr>
  
  <p><em>"This is a message for <strong>Steve</strong> and <strong>Bob</strong>. this is the second sentence in the message for <strong>Bob</strong>"</em></p>
  
  <hr>
  
  <p>If anyone knows or has done anything like this, would really appreciate it!</p>