title: Show progress bar while loading list Firebase
body: <p>I would like to show a progress bar on my screen while I seek a listing in Firebase. How can I do this? </p>
  
  <p>The code as it is now does not show the progress bar. If you can help me, thank you.</p>
  
  <pre><code>@Override
  protected void onResume() {
      super.onResume();
      openProgressBar();
      callConnection();
      mDatabaseReference.child("bakeries").addListenerForSingleValueEvent(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              if (dataSnapshot.getChildrenCount() &gt; 0) {
                  closeProgressBar();
                  adapter = new FirebaseRecyclerAdapter&lt;Bakery, BakeryViewHolder&gt;(
                          Bakery.class,
                          R.layout.card_bakery,
                          BakeryViewHolder.class,
                          //referencing the node where we want the database to store the data from our Object
                          mDatabaseReference.child("bakeries").getRef()
                  ) {
                      @Override
                      protected void populateViewHolder(BakeryViewHolder viewHolder, final Bakery model, final int position) {
                          if (tvNoBakeries.getVisibility() == View.VISIBLE) {
                              tvNoBakeries.setVisibility(View.GONE);
                          }
                          if (icBakery.getVisibility() == View.VISIBLE) {
                              icBakery.setVisibility(View.GONE);
                          }
                          viewHolder.tvBakeryName.setText(model.getFantasyName());
                          viewHolder.tvPhone.setText(model.getFone());
                          viewHolder.tvDistrict.setText(model.getAdress().getDistrict());
                          distance = GeoLocation.distanceCalculate(userLatitude, userLongitude,
                                  model.getAdress().getLatitude(), model.getAdress().getLongitude());
                          viewHolder.tvDistance.setText(String.valueOf(distance));
                          //Picasso.with(MainActivity.this).load(model.getMoviePoster()).into(viewHolder.ivMoviePoster);
  
                          viewHolder.mView.setOnClickListener(new View.OnClickListener() {
                              @Override
                              public void onClick(View view) {
                                  Log.w(TAG, "You clicked on " + model.getId());
                                  bakeryID = model.getId();
                                  String name = model.getFantasyName();
                                  params.putString("bakeryID", bakeryID);
                                  params.putString("name", name);
                                  Intent intentProductList = new Intent(BakeryListActivity.this, ProductListActivity.class);
                                  intentProductList.putExtras(params);
                                  startActivity(intentProductList);
                              }
                          });
                      }
                  };
                  rvBakery.setAdapter(adapter);
              } else {
                  tvNoBakeries.setVisibility(View.VISIBLE);
                  icBakery.setVisibility(View.VISIBLE);
              }
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
              Log.w(TAG, "getUser:onCancelled", databaseError.toException());
          }
      });
  
  }
  </code></pre>
  
  <p>call progress bar activity Common Activity</p>
  
  <pre><code>protected void openProgressBar(){
      progressBar.setVisibility( View.VISIBLE );
  }
  
  protected void closeProgressBar(){
      progressBar.setVisibility( View.GONE );
  }
  </code></pre>