title: Android Firebase retrieve data back to gridView
body: <p>I'm new to programming and I just started doing my first android project. I've been stuck in the problem for hours and still have no idea why it doesn't work. Here's the data structure below.</p>
  
  <p><a href="https://i.stack.imgur.com/wDfGQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wDfGQ.png" alt="enter image description here"></a></p>
  
  <p>I want to add journals for their respective users, the addJournal() function that I implemented is working. But it crashes when I retrieve back those journals from the database to the gridView.</p>
  
  <p>Here's how I add Journals to the database below: </p>
  
  <pre><code>        firebaseAuth = FirebaseAuth.getInstance();
          firebaseUser = firebaseAuth.getCurrentUser();
          journalReference=FirebaseDatabase.getInstance().getReference();
  
          String journalName = etJournalName.getText().toString().trim();
          String companyName = etCompanyName.getText().toString().trim();
          String journalColor = "blankForNow";
          String userID = firebaseUser.getUid();
          String journalID = journalReference.push().getKey();
  
          //validation
          if (TextUtils.isEmpty(journalName)){
              etJournalName.setError("Journal name must not be empty");
          } else if (TextUtils.isEmpty(companyName)){
              etCompanyName.setError("Company name must not be empty");
          } else {
              //storing data to the database...
              Journal journal = new Journal(journalID, userID, journalName, companyName, journalColor);
              journalReference.child("users")
                      .child(userID)
                      .child("journals")
                      .child(journalID).setValue(journal);
          }
  </code></pre>
  
  <p>And here's how I retrieve data below:</p>
  
  <pre><code>    DatabaseReference journalRef = 
      FirebaseDatabase.getInstance().getReference();
      journalRef.child("users")
      .child(userID)
      .child("journals").addChildEventListener(new ChildEventListener() {
          @Override
          public void onChildAdded(DataSnapshot dataSnapshot, String s) {
              journalArrayList.clear();
              for (DataSnapshot journalDS : dataSnapshot.getChildren()) {
                  Journal journal = journalDS.getValue(Journal.class);
                  journalArrayList.add(journal);
              }
              gridViewAdapter = new GridViewAdapter(MainActivity.this, journalArrayList);
              gridView.setAdapter(gridViewAdapter);
          }
  
          @Override
          public void onChildChanged(DataSnapshot dataSnapshot, Strin
  </code></pre>
  
  <p>Can someone help me out?
  Thanks in advance</p>