title: response.body() result changes during execution. (retrofit2-get method)
body: <p>I'm a beginner learning Android.
  I'm trying to make my application receive data from local database.
  So I used retroit2 as followed</p>
  <pre><code>public class SNSDataServicer {
      private String BASE_URL = &quot;http://10.0.2.2:8080/&quot;;
  
      Retrofit retrofitClient =
              new Retrofit.Builder()
                      .baseUrl(BASE_URL)
                      .addConverterFactory(GsonConverterFactory.create())
                      .build();
  
      SelectAPI select = retrofitClient.create(SelectAPI.class);
      InsertAPI insert = retrofitClient.create(InsertAPI.class);
      UpdateAPI update = retrofitClient.create(UpdateAPI.class);
      DeleteAPI delete = retrofitClient.create(DeleteAPI.class);
  }
  
  interface SelectAPI{
      @GET(&quot;sns/all/{candidate}&quot;)
      Call&lt;List&lt;SNSData&gt;&gt; selectAllByCandidate(@Path(&quot;candidate&quot;) String candidate);
  }
  </code></pre>
  <p>and this is the code for MainActivity.java</p>
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      SNSDataServicer dataService = new SNSDataServicer();
      List&lt;SNSData&gt; snsDataList;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          TextView checker = findViewById(R.id.checker);
          Button button = findViewById(R.id.button);
  
          button.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  dataService.select.selectAllByCandidate(&quot;3&quot;).enqueue(new Callback&lt;List&lt;SNSData&gt;&gt;() {
                      @Override
                      public void onResponse(Call&lt;List&lt;SNSData&gt;&gt; call, Response&lt;List&lt;SNSData&gt;&gt; response) {
                          snsDataList = response.body();
                          return;
                      }
                      @Override
                      public void onFailure(Call&lt;List&lt;SNSData&gt;&gt; call, Throwable t) {
                          t.printStackTrace();
                          Toast.makeText(getApplicationContext(), &quot;Fail&quot;, Toast.LENGTH_LONG).show();
                          Log.d(&quot;Failure&quot;, &quot;onResponse: Failed&quot;);
                      }
                  });
  
                  if(snsDataList==null) {
                      checker.setText(&quot;null&quot;);
                  } else {
                      checker.setText(snsDataList.get(0).getMedia());
                  }
              }
          });
      }
  }
  </code></pre>
  <p><strong>When I press button, the textview's text should be set to size of the list.
  But snsDataList kept on returning null
  eventhough reponse.body() returned list successfully</strong></p>
  <p>below is scree capture of my debugging.</p>
  <p>1.
  <a href="https://i.stack.imgur.com/pSo0e.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>by this point it was perfect, but when I hit F8 to debug next step</p>
  <ol start="2">
  <li><a href="https://i.stack.imgur.com/PO2CB.png" rel="nofollow noreferrer">enter image description here</a></li>
  </ol>
  <p>response body has been changed and when I hit F8 more, it takes me to</p>
  <pre><code>ExecutorCallAdapterFactory.java
  Handler.class
  Looper.class
  </code></pre>
  <p>and no more.</p>
  <p>Then suddenly my snsDataList becomes null...</p>
  <p>This is ridiculously hard for me and I've tried to solve it by myself for very long but I have failed...
  Can someone help me with this problem? It will be really grateful.</p>