title: Why my username doesn't appear in the TextView?
body: <p>I have a <code>java.lang.NullPointerException</code> and I don't know how to fix it. My username doesn't appear in the <strong>TextView</strong>.</p>
  
  <pre><code>public class Main extends AppCompatActivity {
  
    CircleImageView profilepic;
    TextView profileuser;
  
    FirebaseUser firebaseUser;
    DatabaseReference reference;
  
    @Override
    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Toolbar toolbar = findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
      getSupportActionBar().setTitle("");
  
      profilepic = findViewById(R.id.profile_image);
      profileuser = findViewById(R.id.username);
  
      firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
      reference = FirebaseDatabase.getInstance().getReference("Users").child(firebaseUser.getUid());
  
      reference.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
              User user = dataSnapshot.getValue(User.class);
              profileuser.setText(user.getUsername());
              if (user.getImageURL().equals("default")){
                  profilepic.setImageResource(R.mipmap.ic_launcher);
              }else{
                  Glide.with(Main.this).load(user.getImageURL()).into(profilepic);
              }
          }
  
          @Override
          public void onCancelled(@NonNull DatabaseError databaseError) {
  
          }
      });
  </code></pre>
  
  <p>The log say I have an error on <code>profileuser.setText(user.getUsername());</code> please help me.</p>
  
  <p>Heres my logcat:</p>
  
  <pre><code>java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
          at com.aceappantipolo.user.aceantipolo.Main$1.onDataChange(Main.java:65)
          at com.google.firebase.database.core.ValueEventRegistration.fireEvent(com.google.firebase:firebase-database@@16.0.5:75)
          at com.google.firebase.database.core.view.DataEvent.fire(com.google.firebase:firebase-database@@16.0.5:63)
          at com.google.firebase.database.core.view.EventRaiser$1.run(com.google.firebase:firebase-database@@16.0.5:55)
          at android.os.Handler.handleCallback(Handler.java:739)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:148)
          at android.app.ActivityThread.main(ActivityThread.java:5541)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:737)
  </code></pre>