title: Recyclerview disappers when EditText not in Focus
body: <p>I am making an android app, it has an editText on the top and a recyclerview on the buttom.</p>
  <p><strong>Every time when a user hit &quot;enter&quot; in the editText field, I will then make an API call with OKHttp and save the info I needed to a Singleton Class so my adapter can use it and update the list.</strong></p>
  <p><strong>However, the recyclerview is not showing(updating) if the focus is not in the editText</strong></p>
  <p><a href="https://i.stack.imgur.com/DLUdU.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DLUdU.gif" alt="Here is how it is working on my device" /></a></p>
  <p><strong>&quot;V/ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed&quot;</strong>
  It's showing this everytime when I click on the editText, I googled it and found out it might be the thread issues. The only place I interact with thread is the API request I made with okHTTP. However, the request returns and interpret the json file correctly.</p>
  <pre><code>    public Boolean makeCall (String parameter) throws IOException, UnirestException {
  
      // make the api call
      String completedLink = BASE_LINK + parameter;
      Future&lt;HttpResponse&lt;com.mashape.unirest.http.JsonNode&gt;&gt; response = Unirest.get(&quot;https://mashape-community-urban-dictionary.p.rapidapi.com/define?term=wat&quot;)
              .header(&quot;x-rapidapi-host&quot;, &quot;mashape-community-urban-dictionary.p.rapidapi.com&quot;)
              .header(&quot;x-rapidapi-key&quot;, &quot;xxxxx&quot;)
              .asJsonAsync(new Callback&lt;com.mashape.unirest.http.JsonNode&gt;() {
                  @Override
                  public void completed(HttpResponse&lt;com.mashape.unirest.http.JsonNode&gt; response) {
                      // decode the response body
                      ObjectMapper objectMapper = new ObjectMapper();
                      JsonNode node = null;
                      try {
                          node = objectMapper.readTree(String.valueOf(response.getBody()));
                      } catch (JsonProcessingException ex) {
                          ex.printStackTrace();
                      }
                      JsonNode resultNode = node.get(&quot;list&quot;);
                      List&lt;WordItem&gt; resultList = null;
                      try {
                          resultList = objectMapper.readValue(resultNode.toString(),
                                  new TypeReference&lt;List&lt;WordItem&gt;&gt;() {});
                      } catch (JsonProcessingException ex) {
                          ex.printStackTrace();
                      }
                      SavedInfo.getInstance().setResult(resultList);
                  }
  
                  @Override
                  public void failed(UnirestException e) {
  
                  }
  
                  @Override
                  public void cancelled() {
  
                  }
              });
  
      return true;
  }
  </code></pre>
  <p>Every time when I hit enter on the soft keyboard, my code will start making the API call</p>
  <pre><code>        mResult.setAdapter(adapter);
      mResult.setNestedScrollingEnabled(false);
      mResult.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
      mResult.setLayoutManager(new LinearLayoutManager(getContext()));
  
      mSearchBox.setOnEditorActionListener(new TextView.OnEditorActionListener() {
                  @Override
                  public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
                      if (i == EditorInfo.IME_ACTION_DONE) {
  
                          // show progress bar
                          hideProgressBar(false, mProgress);
  
                          mHomeText.setText(textView.getText());
                          try {
                              if (new HttpRequest().makeCall(textView.getText().toString())){
                                  adapter.updateList();
                              }
                              else {
                                  // showing error message
                              }
                          } catch (IOException e) {
                              e.printStackTrace();
                              return false;
                          }
                          hideProgressBar(true, mProgress);
  
                          // hide keyword when enter key is detected
                          View view = getActivity().getCurrentFocus();
                          if (view != null) {
                              InputMethodManager imm = (InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
                              imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
                          }
                      }
                      return true;
                  }
      });
  </code></pre>
  <p>Also, one thing to point out is the Progress Bar(I set it to &quot;VISIBLE&quot; but not showing still)is not showing at all. I set a few places throughout my code, the Singleton Class and Http Requests are correct and return + save correct info.</p>
  <p>Here is my updateList() in my adapter class just in case this helps</p>
  <pre><code>   public void updateList () {
      list.clear();
      list.addAll(SavedInfo.getInstance().getResult());
      notifyDataSetChanged();
    }
  </code></pre>
  <p>Here is the my layout file</p>
  <pre><code>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.ui.home.HomeFragment&quot;
      android:orientation=&quot;vertical&quot;&gt;
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:id=&quot;@+id/constraintLayout&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;200dp&quot;
          android:background=&quot;#F3F3F3&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;&gt;
  
          &lt;TextView
              android:id=&quot;@+id/title_word_home&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;0dp&quot;
              android:layout_marginTop=&quot;36dp&quot;
              android:fontFamily=&quot;sans-serif&quot;
              android:text=&quot;@string/home_text&quot;
              android:textAlignment=&quot;center&quot;
              android:textSize=&quot;28sp&quot;
              android:textStyle=&quot;bold&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot;
              tools:layout_editor_absoluteX=&quot;0dp&quot; /&gt;
  
          &lt;EditText
              android:id=&quot;@+id/searchBox&quot;
              android:layout_width=&quot;254dp&quot;
              android:layout_height=&quot;50dp&quot;
              android:layout_marginStart=&quot;239dp&quot;
              android:layout_marginEnd=&quot;239dp&quot;
              android:autofillHints=&quot;&quot;
              android:drawableStart=&quot;@drawable/ic_search&quot;
              android:drawablePadding=&quot;10dp&quot;
              android:ems=&quot;10&quot;
              android:hint=&quot;@string/searchBox_hint&quot;
              android:imeOptions=&quot;actionDone&quot;
              android:inputType=&quot;text&quot;
              android:pointerIcon=&quot;none&quot;
              app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintTop_toBottomOf=&quot;@+id/title_word_home&quot; /&gt;
  
  
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
      &lt;LinearLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:orientation=&quot;vertical&quot;&gt;
  
          &lt;ProgressBar
              android:id=&quot;@+id/loading_progress&quot;
              android:layout_width=&quot;50dp&quot;
              android:layout_height=&quot;50dp&quot;
              android:layout_gravity=&quot;center|center_vertical&quot;
              android:indeterminate=&quot;true&quot;
              android:visibility=&quot;gone&quot; /&gt;
  
          &lt;androidx.recyclerview.widget.RecyclerView
              android:id=&quot;@+id/home_resultList&quot;
              android:layout_width=&quot;409dp&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:visibility=&quot;visible&quot; /&gt;
  
      &lt;/LinearLayout&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>Thank you for reading!</p>