title: Using a progress bar
body: <p>How do i use a progress bar in this kind of scenario?? I want a progress bar to show once the register button is clicked and if registration is successful, i also want to give a success massage to the user:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_sme);
  
      Firebase.setAndroidContext(this);
  
      bizname = (EditText) findViewById(R.id.bizname);
      location = (EditText) findViewById(R.id.location);
      biztype = (EditText) findViewById(R.id.biztype);
      pin = (EditText) findViewById(R.id.pin);
      register = (Button) findViewById(R.id.register);
      progressBar = (ProgressBar) findViewById(R.id.progressBar);
  
      register.setOnClickListener(new View.OnClickListener() {
          @RequiresApi(api = Build.VERSION_CODES.N)
          @Override
          public void onClick(View v) {
              //Creating firebase object
              **progressBar.setVisibility(View.VISIBLE);**
              final Firebase ref = new Firebase("https://mcn-africa.firebaseio.com/");
  
              //Getting values to store
              String Username = bizname.getText().toString();
              String Name = biztype.getText().toString();
              String Id = pin.getText().toString();
              String Location = location.getText().toString();
  
              Members members = new Members();
              members.setUsername(Username);
              members.setLocation(Location);
              members.setName(Name);
              members.setId(Id);
  
  
  
              Firebase newRef = ref.child("SMEs").push();
  
  
              newRef.setValue(members);
              progressBar.setVisibility(View.GONE);
  
          }
      });
  }
  </code></pre>
  
  <p>}
  any ideas will be appreciated</p>