title: Channel is unrecoverably broken and will be disposed
body: <p>I am creating a customer registration page which adds a customer to my firebase database. Once registered the app should move onto the next activity which is a google map. The customer is added to the databse but crashes when moving onto the next activity. Here is my code:</p>
  
  <p>SignupActivityCustomer.java:</p>
  
  <pre><code>import android.content.Intent;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Log;
  import android.util.Patterns;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.ProgressBar;
  import android.widget.Toast;
  
  import com.google.android.gms.tasks.OnCompleteListener;
  import com.google.android.gms.tasks.Task;
  import com.google.firebase.auth.AuthResult;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.database.FirebaseDatabase;
  
  public class SignupActivityCustomer extends AppCompatActivity implements View.OnClickListener {
  
      private EditText editTextName, editTextEmail, editTextPassword, editTextPhone;
      private ProgressBar progressBar;
  
      private FirebaseAuth mAuth;
  
      private static final String TAG = "SignupActivityCustomer";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_signup_customer);
  
          editTextName = findViewById(R.id.edit_text_name);
          editTextEmail = findViewById(R.id.edit_text_email);
          editTextPassword = findViewById(R.id.edit_text_password);
          editTextPhone = findViewById(R.id.edit_text_phone);
          progressBar = findViewById(R.id.progressbar);
          progressBar.setVisibility(View.GONE);
  
          mAuth = FirebaseAuth.getInstance();
  
          findViewById(R.id.button_register).setOnClickListener(this);
      }
  
      @Override
      protected void onStart() {
          super.onStart();
  
          if (mAuth.getCurrentUser() != null) {
              //handle the already login user
          }
      }
  
      private void registerUser() {
          final String name = editTextName.getText().toString().trim();
          final String email = editTextEmail.getText().toString().trim();
          String password = editTextPassword.getText().toString().trim();
          final String phone = editTextPhone.getText().toString().trim();
  
          if (name.isEmpty()) {
              editTextName.setError(getString(R.string.input_error_name));
              editTextName.requestFocus();
              return;
          }
  
          if (email.isEmpty()) {
              editTextEmail.setError(getString(R.string.input_error_email));
              editTextEmail.requestFocus();
              return;
          }
  
          if (!Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
              editTextEmail.setError(getString(R.string.input_error_email_invalid));
              editTextEmail.requestFocus();
              return;
          }
  
          if (password.isEmpty()) {
              editTextPassword.setError(getString(R.string.input_error_password));
              editTextPassword.requestFocus();
              return;
          }
  
          if (password.length() &lt; 6) {
              editTextPassword.setError(getString(R.string.input_error_password_length));
              editTextPassword.requestFocus();
              return;
          }
  
          if (phone.isEmpty()) {
              editTextPhone.setError(getString(R.string.input_error_phone));
              editTextPhone.requestFocus();
              return;
          }
  
          if (phone.length() != 10) {
              editTextPhone.setError(getString(R.string.input_error_phone_invalid));
              editTextPhone.requestFocus();
              return;
          }
  
  
          progressBar.setVisibility(View.VISIBLE);
          mAuth.createUserWithEmailAndPassword(email, password)
                  .addOnCompleteListener(new OnCompleteListener&lt;AuthResult&gt;() {
                      @Override
                      public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
                          Log.d(TAG, "adding customer");
                          if (task.isSuccessful()) {
  
                              Customer user = new Customer(
                                      name,
                                      email,
                                      phone
                              );
  
                              FirebaseDatabase.getInstance().getReference("Customers")
                                      .child(FirebaseAuth.getInstance().getCurrentUser().getUid())
                                      .setValue(user).addOnCompleteListener(new OnCompleteListener&lt;Void&gt;() {
                                  @Override
                                  public void onComplete(@NonNull Task&lt;Void&gt; task) {
                                      progressBar.setVisibility(View.GONE);
                                      Log.d(TAG, "customer added");
                                      if (task.isSuccessful()) {
                                          startActivity(new Intent(SignupActivityCustomer.this, CustomerHome.class));
                                      } else {
                                          //display a failure message
                                      }
                                  }
                              });
  
                          } else {
                              Toast.makeText(SignupActivityCustomer.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();
                          }
                      }
                  });
  
      }
  
      @Override
      public void onClick(View v) {
          switch (v.getId()) {
              case R.id.button_register:
                  registerUser();
                  break;
          }
      }
  }
  
  Logcat error:
  
  2019-01-26 11:29:10.843 4038-4038/com.example.julie.fyp D/SignupActivityCustomer: customer added
  2019-01-26 11:29:11.669 1880-1959/? W/InputDispatcher: channel '4a251a2 com.example.julie.fyp/com.example.julie.fyp.SignupActivityCustomer (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
  2019-01-26 11:29:11.669 1880-1959/? E/InputDispatcher: channel '4a251a2 com.example.julie.fyp/com.example.julie.fyp.SignupActivityCustomer (server)' ~ Channel is unrecoverably broken and will be disposed!
  2019-01-26 11:29:11.719 1880-2523/? W/InputDispatcher: Attempted to unregister already unregistered input channel '4a251a2 com.example.julie.fyp/com.example.julie.fyp.SignupActivityCustomer (server)'
  </code></pre>