title: SwipeRefreshLayout setRefreshing not showing progress bar in Fragment
body: <p>I am using the following code in this fragment:</p>
  
  <pre><code>public class OwnerPendingBookingsFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener {
  
  private View myView;
  private ListView booking_list;
  private ArrayAdapter adapter;
  private SharedPreferences preferences;
  private BookingList bookings;
  private SwipeRefreshLayout swipe;
  
  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          myView = inflater.inflate(R.layout.owner_pending_bookings_layout, container, false);
  
          swipe = (SwipeRefreshLayout) myView.findViewById(R.id.swipe);
          swipe.setOnRefreshListener(this);
          swipe.post(new Runnable() {
                         @Override
                         public void run() {
                             swipe.setRefreshing(true);
  
                             new FindBookings().execute("");
                         }
                     }
          );
  
      return myView;
  }
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
  }
  
  
  private void setUpAdapter(){
      booking_list = (ListView) myView.findViewById(R.id.pending_bookings);
      if(bookings.getBookings().size() == 0){
          booking_list.setVisibility(View.GONE);
          LinearLayout no_vehicles = (LinearLayout) myView.findViewById(R.id.no_bookings_layout);
          no_vehicles.setVisibility(View.VISIBLE);
      }else {
          new setImageTask().execute("");
          adapter = new OwnerPendingBookingsAdapter(myView.getContext(), bookings.getBookings());
          booking_list.setAdapter(adapter);
          booking_list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                  int booking_line = bookings.getBookings().get(position).getBooking_line_id();
                  Fragment booking_info = new OwnerPendingBookingInfoFragment();
                  Bundle args = new Bundle();
                  args.putInt("bookingLine", booking_line);
                  booking_info.setArguments(args);
                  FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
                  transaction.replace(R.id.content_frame, booking_info);
                  transaction.addToBackStack(null);
                  transaction.commit();
              }
          });
          booking_list.setVisibility(View.VISIBLE);
      }
      //LinearLayout progressBar = (LinearLayout) myView.findViewById(R.id.loadingPanel);
      //progressBar.setVisibility(View.GONE);
  }
  
  @Override
  public void onRefresh() {
      swipe.setRefreshing(true);
      new FindBookings().execute("");
  }
  
  private class FindBookings extends AsyncTask&lt;String, Void, String&gt; {
      String token = preferences.getString(Config.TOKEN, "");
  
  
      public FindBookings() {
      }
  
      @Override
      protected void onPreExecute() {
          swipe.setRefreshing(true);
      }
  
      @Override
      protected void onPostExecute(String s){
          setUpAdapter();
          swipe.setRefreshing(false);
      }
  
      @Override
      protected String doInBackground(String... params) {
          bookings = DBConnect.getInfo();
          return "done";
      }
  }
  </code></pre>
  
  <p>And I have the following layout:</p>
  
  <pre><code>&lt;android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/swipe"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"&gt;
  &lt;ListView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/pending_bookings"
      android:layout_gravity="center_horizontal"
      android:divider="@null"
      android:visibility="gone"/&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/no_bookings_layout"&gt;
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:text="@string/no_vehicles"
          android:textSize="25dp"
          android:textAlignment="center"
          /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>The first time it starts, it make it correctly I see the progress rolling until it finishes the proccess. But then everytime I swipe down it starts updating but I don't see the progress bar. </p>
  
  <p>I check <a href="https://stackoverflow.com/questions/26858692/swiperefreshlayout-setrefreshing-not-showing-indicator-initially">SwipeRefreshLayout setRefreshing() not showing indicator initially</a> and <a href="https://stackoverflow.com/questions/35295115/android-progressbar-styled-like-progress-view-in-swiperefreshlayout">Android ProgressBar styled like progress view in SwipeRefreshLayout</a> but none of this answers worked for me. </p>