title: Why setVisibility doesn't work on a Fragment/FrameLayout
body: <p>I have a layout with an Indeterminate Progress Bar, and when passed 3 seconds I want to hide this progress bar and show a webview, but for some reason It doesn't work.</p>
  
  <p>This is my XML:</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/fl_register_oauth"
      tools:context=".fragments.RegisterFragment"
      android:background="@color/f_yellow"&gt;
  
      &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context=".MainActivity$PlaceholderFragment"
          android:gravity="center"
          android:layout_gravity="center"
          android:orientation="vertical"&gt;
  
          &lt;LinearLayout
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:id="@+id/ll_pbar"
              android:gravity="center"
              android:visibility="gone"&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;ProgressBar
              android:id="@+id/progressBar"
              style="?android:attr/progressBarStyleLarge"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:indeterminateDrawable="@drawable/progress" /&gt;
  
          &lt;WebView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:id="@+id/webView"
              android:visibility="gone"
              android:layout_gravity="center" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;FrameLayout
          android:id="@+id/FlashBarLayout"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal|bottom"
          android:layout_marginBottom="72dp"&gt;
          &lt;!-- flash bar content --&gt;
      &lt;/FrameLayout&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>And this is my source code of the fragment.</p>
  
  <pre><code>public class RegisterFragment extends Fragment {
  
  ...
  
  @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          View view = inflater.inflate(R.layout.fragment_register, container, false);
  
          bar = (ProgressBar) view.findViewById(R.id.progressBar);
  
          webView = (WebView) view.findViewById(R.id.webView);
          webView.getSettings().setJavaScriptEnabled(true);
  
          getActivity().runOnUiThread(new Runnable() {
              @Override
              public void run() {
                  bar.setVisibility(View.GONE);
                  webView.setVisibility(View.VISIBLE);
              }
          });
  </code></pre>
  
  <p>I have tried to do it with a Handler with postDelayed, but I've realized that it's not working, eventhough I write it out of the handler this lines.</p>
  
  <pre><code>bar.setVisibility(View.GONE);
  webView.setVisibility(View.VISIBLE);
  </code></pre>
  
  <p>Thank you for your help.</p>