title: Retrieving multiple data from friebase database to recyclerview
body: <p>I know this might going to be a dumb question but I’m having some issues with the firebase real time database in recycle viewer. It either gives me an error message or just simply doesn’t refresh. However when I add the data manually it’s working. I’ve read tons of problem solving articles but I still can’t solve the problem. I hope you guys can help somehow.</p>
  
  <p>Heres my database:
  <a href="https://i.stack.imgur.com/BHSsO.png" rel="nofollow noreferrer">database link</a></p>
  
  <p>And here is my MainActivity:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  private RecyclerView reciclerView;
  private MyAdapter adapter;
  private List&lt;ListItem&gt; result;
  private DatabaseReference myRootRef = FirebaseDatabase.getInstance().getReference();
  private ListItem model = new ListItem();
  
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      reciclerView = findViewById(R.id.reciclerViewID);
      reciclerView.setHasFixedSize(true);
      reciclerView.setLayoutManager(new LinearLayoutManager(this));
  
      result = new ArrayList&lt;&gt;();
  
  
  
  myRootRef.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  for (DataSnapshot postSnapshot: dataSnapshot.getChildren()) {
                      model = postSnapshot.getValue(ListItem.class);
                      result.add(model);
                  }
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
  
              }
          });
  
      /*model.setName("Johhny");
      model.setEmail("Johhny@gmail.com");
      model.setImageurl("https://uniqlo.scene7.com/is/image/UNIQLO/goods_04_172340?$detail$");*/
  
  
      adapter = new MyAdapter(this, result);
      reciclerView.setAdapter(adapter);
      adapter.notifyDataSetChanged();
  
  
  }
  </code></pre>
  
  <p>The ListItem is the model class, and i also have a DetailsActivity.</p>