title: setVisibility(View.GONE) does not work in Fragment
body: <p>I have a FragmentActivity that's parsing JSON and updates the view. OnCreate I have a ProgressBar initialized when my view is still in the load process. Then after the loading is done, I set </p>
  
  <pre><code>progressBar.setVisibility(View.GONE);
  </code></pre>
  
  <p>but it would not take affect. I did make sure that its exactly same instance by doing toString() on the progressBar variable and its exactly same. I also made sure that its actually reaches the point. Also I donn't have any onClicks here, it simply needs to dissapear when content is loaded.</p>
  
  <p>I watched <a href="https://www.youtube.com/watch?v=zrAUBwyb7Q0" rel="nofollow noreferrer">this tutorial</a> and it works for the guy there. </p>
  
  <p>Method that's  setting the visibility to GONE</p>
  
  <pre><code>  public void updateUI(){
     if(movies != null) {
         for (int i = 0; i &lt; array1.length; i++) {
             //Log.v("PATH in array1 " , movies.get(i).getPath());
             array1[i] = (movies.get(i).getPath());
         }
  
         gridView.setAdapter(imageAdapter);
  
  
     }else{
         Log.v("MOVIE ARRAY", "- I HAVE NO DATA");
     }
  
      Log.v("HIDE", "BEFORE");
      Log.v("PROGRESS_BAR", progressBar.toString());
      progressBar.setVisibility(View.GONE);
  
      Log.v("HIDE", "AFTER");
  
  }
  </code></pre>
  
  <p>My onCreate method that creates the variable </p>
  
  <pre><code>    @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View v = inflater.inflate(R.layout.fragment_main, null);
      this.progressBar = (ProgressBar)v.findViewById(R.id.progress_bar);
  
      Log.v("PROGRESS_BAR", progressBar.toString());
  
      if (savedInstanceState != null){
          Log.v("onCreate ", "EXISTING STATE");
          this.movies = savedInstanceState.getParcelableArrayList("movies");
      }else{
          Log.v("onCreate ", "EMPTY STATE");
      } 
  
      setHasOptionsMenu(true);
  
  
  }
  </code></pre>
  
  <p>onStart</p>
  
  <pre><code> @Override
  public void onStart() {
      super.onStart();
      Log.v("onStart ", "START");
      //Log.v("Movies Size ", String.valueOf(movies.size()));
              update();
  }
  </code></pre>
  
  <p>update()</p>
  
  <pre><code> private void update(){
  
      SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
      String sortType = prefs.getString(getString(R.string.pref_sort_key), getString(R.string.pref_sort_default));
  
      if (sortType.equals(sortTypeSaved)){
          Log.v("Equals", "YAY");
          Log.v(sortType.toString(), sortTypeSaved.toString());
  
          if (movies == null || movies.isEmpty()){
  
              Log.v("movies ARRAY", "EMPTY");
              DownloadJsonDataTask asyncDownload = new DownloadJsonDataTask();
              asyncDownload.execute(sortType);
          }else{
              Log.v("Equals", "NOPE");
              Log.v("movies ARRAY", " not EMPTY");
              updateUI();
          }
      }else{
          Log.v(sortType.toString(), sortTypeSaved.toString());
         // if (movies == null || movies.isEmpty()){
          DownloadJsonDataTask asyncDownload = new DownloadJsonDataTask();
              asyncDownload.execute(sortType);
        //  }else{
         // }
      }
  </code></pre>
  
  <p>in case if asynctask was run then i call it from onPostExacute</p>
  
  <pre><code>  @Override
      protected void onPostExecute(List&lt;Movie&gt; movies) {
          updateUI();
      }
  </code></pre>
  
  <p>Here is the screen of the log where you can see that its definately the same instance <a href="https://i.stack.imgur.com/zmyRy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zmyRy.png" alt="enter image description here"></a></p>
  
  <p>Please let me know what am I doing wrong, I have been on this all day and cannot find the solution.
  Thank you</p>