title: How to restrict automatically inserting text to view when selecting a item from drop down menu Android
body: <p>I am working on <code>MultiAutoCompleteTextView</code>. This view has a <code>ArrayAdapter</code>.</p>
  
  <p>Like this:</p>
  
  <pre><code>ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
              android.R.layout.simple_dropdown_item_1line, COUNTRIES);
  
  final MultiAutoCompleteTextView textView = 
              (MultiAutoCompleteTextView) findViewById(R.id.tv);
  textView.setAdapter(adapter);
  </code></pre>
  
  <p>And drop down menu:</p>
  
  <pre><code>private static final String[] COUNTRIES = new String[]{
              "Belgium", "France", "Italy", "Germany", "Spain"};
  </code></pre>
  
  <p>User may select a item from drop down menu shown by some text user typed. at that time, the text user typed is replaced by selected item.</p>
  
  <p>I want to know where this replacement is implemented or how to restrict this replacement. because when user select item, i want to insert text of selected item with additional text to <code>MultiAutoCompleteTextView</code>. (e.g., change "Belgium" to "I Love Belgium")</p>
  
  <p>I can get selected item's string in <code>OnItemClickListener</code>. so try to change.</p>
  
  <pre><code>textView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
          if (position &lt; 0) {
              return;
          }
  
          // get selected item string
          String selItem = (String) textView.getAdapter().getItem(position);
  
          // find text user typed
          Editable editable = textView.getText();
          int end = textView.getSelectionEnd();
          int start = mTokenizer.findTokenStart(editable, end);
  
          // i want to change like this..
          String str = "I Love ";
          str += TextUtils.substring(editable, start, end);
  
          // replace text user typed by selected Item
          editable.replace(start, end, str);
      }
  });
  </code></pre>
  
  <p>I expect the result is "I Love Belgium" only. But the result is "Belgium, I Love Belgium, ". I want to know where this replacement is implemented or how to restrict this replacement.</p>