title: Retrieve Data from Firebase Database and display on RecyclerView
body: <p>The application crashes when i run it, but I don't see anything wrong tih my code. I'm trying to retrieve data on firebase to <code>recyclerview</code>. I'm making a post comments app. Please help me to see what's wrong with my codes.</p>
  
  <p>Java Code</p>
  
  <pre><code>public class DialogComments extends AppCompatActivity implements View.OnClickListener {
  
      private FirebaseAuth mAuithComment;
      private ProgressDialog mProgressDialog;
      private EditText etComment;
      private DatabaseReference dbRef;
      private FirebaseDatabase mDatabaseComment;
      private RecyclerView recyclerView;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_dialog_comments);
  
  
          recyclerView = (RecyclerView) findViewById(R.id.comment_recyclerview);
          recyclerView.setHasFixedSize(true);
          recyclerView.setLayoutManager(new LinearLayoutManager(this));
  
          mDatabaseComment = FirebaseDatabase.getInstance();
          dbRef = mDatabaseComment.getReference("UserComments");
  
  
      }
  
      @Override
      protected void onStart(){
          super.onStart();
  
          FirebaseRecyclerAdapter&lt;CommentModels, CommentViewHolder&gt; firebaseRecyclerAdapter =
                  new FirebaseRecyclerAdapter&lt;CommentModels, CommentViewHolder&gt;
                          (
                                  CommentModels.class,
                                  R.layout.row_comment,
                                  CommentViewHolder.class,
                                  dbRef
                          )
                  {
                      @Override
                      protected void populateViewHolder(CommentViewHolder viewHolder, CommentModels model, int position) {
                          viewHolder.setusername(model.getusername());
                          viewHolder.setcomment(model.getcomment());
                      }
                  };
  
          recyclerView.setAdapter(firebaseRecyclerAdapter);
      }
  
      public static class CommentViewHolder extends RecyclerView.ViewHolder{
          TextView usernameTextView;
          TextView commentTextView;
          View mView;
  
          public CommentViewHolder(View itemView){
              super(itemView);
              mView = itemView;
              usernameTextView = (TextView) mView.findViewById(R.id.tv_username);
              commentTextView = (TextView) mView.findViewById(R.id.tv_comment);
          }
          public void setusername(String username){
              usernameTextView.setText(username);
  
          }
          public void setcomment(String comment){
              commentTextView.setText(comment);
          }
      }
  
  
      public void init(){
          etComment = (EditText) findViewById(R.id.et_comment);
          findViewById(R.id.iv_send).setOnClickListener(this);
      }
  
      public void sendcomment(){
  
      }
  
      @Override
      public void onClick(View view) {
  
          switch (view.getId()) {
              case R.id.iv_send:
                  sendcomment();
          }
      }
  }
  </code></pre>
  
  <p>row_comment.xml</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="16dp"
      android:orientation="horizontal"&gt;
  
      &lt;LinearLayout
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginLeft="16dp"
          android:layout_marginRight="16dp"
          android:layout_weight="1"
          android:orientation="vertical"&gt;
  
          &lt;TextView
              android:id="@+id/tv_username"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="Username"
              android:textColor="@android:color/black"
              android:textStyle="bold" /&gt;
  
          &lt;TextView
              android:id="@+id/tv_comment"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="4dp"
              android:text="dfsd; lfjsd;fk js;dkfj a;sdfj ;sadfj ;sadlkfj ;asdlkfj a;ldskfj ;alkdjfs ;alksdjf ;alkjdsf"
              android:textColor="@android:color/black" /&gt;
  
      &lt;/LinearLayout&gt;
  
     &lt;!-- &lt;TextView
          android:id="@+id/tv_time"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginRight="16dp"
          android:text="10h30" /
  &lt;/LinearLayout&gt;
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>CommentModels.java</p>
  
  <pre><code>package com.feu.teamanonymous.ayokotseph_final.Variables;
  import java.io.Serializable;
  public class CommentModels implements Serializable {
      String username;
      String comment;
      public CommentModels(String userName, String comment) {
          this.username = userName;
          this.comment = comment;
      }
  
      public String getusername() {
          return username;
      }
  
      public void setUserName(String username) {
          this.username = username;
      }
  
      public String getcomment() {
          return comment;
      }
  
      public void setuComment(String comment) {
          this.comment = comment;
      }
  }
  </code></pre>
  
  <p>acitivity_dialog_comment.xml</p>
  
  <pre><code>    &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="450dp"
      tools:context="com.feu.teamanonymous.ayokotseph_final.Activities.DialogComments"
      android:orientation="vertical"&gt;
  
          &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/comment_recyclerview"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1" &gt;
  
          &lt;/android.support.v7.widget.RecyclerView&gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="0"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="8dp"&gt;
  
              &lt;EditText
                  android:id="@+id/et_comment"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:hint="Type comment..." /&gt;
  
              &lt;ImageView
                  android:id="@+id/iv_send"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="bottom"
                  android:layout_marginBottom="4dp"
                  android:layout_marginLeft="8dp"
                  android:src="@drawable/ic_send_black_24dp" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.v7.widget.CardView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>