title: AUTOCOMPLETE EDITTEXT
body: <p>I have an edittext and a recyclerview. I want anytime a user enters character "@" as the first character of a new word in edittext, the recyclerview pops up just above the edittext. If the user continues to type after character "@", we are supposed to filter through the recyclerview items to match whatever the user has typed to the items in recyclerview.
  In a nutshell, I want to implement something like the name suggestions in whatsapp group chats once you enter character "@", or in twitter.
  So far, I've been able to show the recyclerview but only if "@" is the first character in edit text but if it is in the second word eg hallo @w.. the recyclerview wont show, please help. Also I need to hide the recyclerview if the user backspaces the "@", or deletes it. Thirdly, how to filter through the shown recyclerview by getting only the text that the user has entered after character "@".
   Please help, any assistance with some show of code will be of great help. Here is what I've tried so far.</p>
  
  <pre><code>   InputFilter filter = new InputFilter() {
          @Override
          public CharSequence filter(CharSequence s, int start, int end, Spanned spanned, int i2, int i3) {
  
              if (s.toString().contains("@")){
  
  
                  foods.setVisibility(View.VISIBLE); //foods is the recyclerview
  
                  userMessageInput.addTextChangedListener(new TextWatcher() {
                      @Override
                      public void beforeTextChanged(CharSequence s, int i, int i1, int i2) {
  
                      }
  
                      @Override
                      public void onTextChanged(CharSequence s, int start, int before, int i2) {
                          //to filter through the recyclerview to match with whatever user has typed after character "@"
                          if (!s.toString().contains(" ")){
  
                              List&lt;FoodObject&gt; mlist = new ArrayList&lt;&gt;();
                              for (FoodObject object: allfoodList){   //allfoodlist is food arraylist passed to food adapter
                                  String name = object.getName().trim().toLowerCase();
                                  if (name.contains(s.toString().toLowerCase())){
                                      mlist.add(object);
                                  }
                                  foodadapter.searchFood(mlist); //foodadapter is the rv adapter
                              }
  
                          } else {
                              foods.setVisibility(View.GONE); 
                          }
  
                      }
  
                      @Override
                      public void afterTextChanged(Editable editable) {
  
                      }
                  });
  
              }
              else {
                  Log.d("showit", "false");
              }
              return null;
          }
      };
  
      userInput.setFilters(new InputFilter[]{filter});  //userinput is the edittext field
  
  //method in rv adapter to  search food
   public void searchFood(List&lt;FoodObject&gt; searchList){
      foodList = new ArrayList&lt;&gt;();
      foodList.addAll(searchList);
      notifyDataSetChanged();
  }
  </code></pre>