title: Displaying multiple items from a Firebase database item in RecyclerView
body: <p>I'm trying to get a RecyclerView filled with info from my firebase database. </p>
  
  <p>I had it working with only 1 item in the database (an int), but now I added a String as well and it won't work any more.</p>
  
  <p>My database structure is </p>
  
  <pre><code>-random key id
    - item: "Coffee"
    - points: 10 
  </code></pre>
  
  <p>Here is my Adapter</p>
  
  <pre><code>public class RecyclerViewAdapter extends 
      RecyclerView.Adapter&lt;RecyclerViewHolders&gt; {
      private List&lt;Points&gt; task;
      protected Context context;
      public RecyclerViewAdapter(Context context, List&lt;Points&gt; task) {
          this.task = task;
          this.context = context;
      }
      @Override
      public RecyclerViewHolders onCreateViewHolder(ViewGroup parent, int 
      viewType) {
          RecyclerViewHolders viewHolder = null;
          View layoutView = 
      LayoutInflater.from(parent.getContext()).inflate(R.layout.to_do_list, 
      parent, false);
          viewHolder = new RecyclerViewHolders(layoutView, task);
          return viewHolder;
      }
      @Override
      public void onBindViewHolder(RecyclerViewHolders holder, int position) 
      {
          holder.categoryTitle.setText((task.get(position).getPoints()));
          holder.itemTitle.setText(task.get(position).getItem());
      }
      @Override
      public int getItemCount() {
          return this.task.size();
      }
  }
  </code></pre>
  
  <p>Here is my ViewHolder</p>
  
  <pre><code>public class RecyclerViewHolders extends RecyclerView.ViewHolder {
      private static final String TAG = 
      RecyclerViewHolders.class.getSimpleName();
      public ImageView markIcon;
      public TextView categoryTitle, itemTitle;
      public ImageView deleteIcon;
      private List&lt;Points&gt; taskObject;
  
      public RecyclerViewHolders(final View itemView, final List&lt;Points&gt; taskObject) {
          super(itemView);
          this.taskObject = taskObject;
          categoryTitle = (TextView) itemView.findViewById(R.id.task_title);
          itemTitle = (TextView) itemView.findViewById(R.id.itemTV);
      }
  }
  </code></pre>
  
  <p>And my code in my main Activity to show to list</p>
  
  <pre><code>    allPoints = new ArrayList&lt;Points&gt;();
              recyclerView = (RecyclerView) 
      view.findViewById(R.id.point_list);
              linearLayoutManager = new LinearLayoutManager(getActivity());
              recyclerView.setLayoutManager(linearLayoutManager);
  
      private void getAllTask (DataSnapshot dataSnapshot) {
          for (DataSnapshot singleSnapshot : dataSnapshot.getChildren()) {
              String taskTitle = singleSnapshot.getValue(String.class);
              String taskItem = singleSnapshot.getValue(String.class);
              allPoints.add(new Points(taskItem, 
      Integer.parseInt(taskTitle)));
              recyclerViewAdapter = new RecyclerViewAdapter(getActivity(), 
      allPoints);
              recyclerView.setAdapter(recyclerViewAdapter);
          }
      }
  </code></pre>
  
  <p>It was working when I was only displaying the 'points', but now that I added the String 'item' it is throwing a NumberFormatExepton on that string.</p>
  
  <blockquote>
    <p>java.lang.NumberFormatException: For input string: "Coffee"</p>
  </blockquote>
  
  <p>Here is my Model class as well</p>
  
  <pre><code>public class Points {
  
      public int points;
      public String item;
  
      public Points(){}
  
      public Points(String item, int points) {
          this.points = points;
          this.item = item;
      }
  
      public int getPoints(){
          return points;
      }
  
      public void setPoints(int points){
          this.points = points;
      }
  
      public String getItem(){
          return item;
      }
  
      public void setItem(String item){
          this.item = item;
      }
  
  }
  </code></pre>
  
  <p>Here's my structure</p>
  
  <pre><code>beans-card
   user
   urx53ou8uBhRODfyqqf57kb8Z0S2
   -KlYnqRvumMfu5h0FvLp
   item: 
     "Coffee"
   points: 
     10
  </code></pre>
  
  <p>and my reference</p>
  
  <pre><code> DatabaseReference db_receipt = 
   FirebaseDatabase.getInstance().getReference().child("user").child(mUserId);
  </code></pre>