title: Why I do not have the values in main activity if I set the variable?
body: <p>So I have the following classes and functions and etc.</p>
  
  <pre><code>public class shitson extends AsyncTask&lt;Void, Void, ArrayList&lt;String&gt;&gt; {
  
  ArrayList&lt;String&gt; tmp = new ArrayList&lt;&gt;();
  private DiaryActivity activity = new DiaryActivity();
  
  public shitson(DiaryActivity diaryActivity) {
      activity = diaryActivity;
  }
  
  protected ArrayList&lt;String&gt; doInBackground(Void... arg0) {
      HttpHandler sh = new HttpHandler();
      String url2 = "https://..............";
      String jsonStr = sh.makeServiceCall(url2);
  
      if (jsonStr != null) {
          try {
  
              JSONArray urlOfURLs = new JSONArray(jsonStr);
              for (int i = 0; i &lt; urlOfURLs.length(); i++) {
                  JSONObject JSONURL = urlOfURLs.getJSONObject(i);
                  String url = JSONURL.getString("url");
                  tmp.add(url);
                  activity.addItem(url);
              }
          } catch (JSONException e) {
              e.printStackTrace();
          }
      }
      return tmp;
  }
  
  @Override
  protected void onPostExecute(ArrayList&lt;String&gt; strings) {
      super.onPostExecute(strings);
      activity.setList(tmp);
  }
  
  public void writeout() {
      for (String i : tmp) {
          Log.e("-0-0-0-0-0-0-0-", i);
      }
  }
  }
  </code></pre>
  
  <p>Main activity: </p>
  
  <pre><code>public class DiaryActivity extends AppCompatActivity {
  
      private ArrayList&lt;String&gt; allURL = new ArrayList&lt;&gt;();
  
      public void writeOut() {
          for (String i : allURL) {
              Log.e("123456789", i);
          }
      }
  
      public void setList(ArrayList&lt;String&gt; list) {
          this.allURL = list;
      }
  
      private void fireYourAsyncTask() {
          new shitson(this).execute();
          writeOut();
      }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_diary);
      fireYourAsyncTask();
  }
  </code></pre>
  
  <p>I build up the "tmp" list but after the activity.setList(tmp) I do not get any data in the main activity. In the shitson.java the "tmp" list has all items but the setList function is not working so I can not work with the list... While my application depends on the informations I get from json... I could not make anything useful on my app because of this bug...</p>