title: Android studio error "cannot resolve method"
body: <p>I am facing a problem in the Java code of my application</p>
  
  <pre><code>        @Override
          public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) 
          {
              Message message = dataSnapshot.getValue(Message.class);
              message.setKey(dataSnapshot.getKey());
              messages.add(message);
              displayMessages(messages);
          }
  </code></pre>
  
  <p>Error thrown :  <code>"cannot resolve method"</code></p>