title: Firebase UI 3.0.0: Retrieve data to recycle view
body: <p>Can anyone help me to retrieve data from the node "foods" and put it in the <code>RecyclerView</code>. These are the file I've been working on but it turns out to be an empty list. I have viewed a tutorial on Internet but most of them were with an older version of Firebase. Recently, Firebase UI has been updated and the data binding process has changed to their new <code>FirebaseRecyclerAdapter</code> structure</p>
  
  <p>This is my database structure:</p>
  
  <pre><code>"foods" : {
  "AntipastoSalad" : {
    "duration" : "30",
    "img" : "https://firebasestorage.googleapis.com/v0/b/mealplanner-ec8ca.appspot.com/o/res%2Fsalad.jpg?alt=media&amp;token=257d4392-8a1f-4fb7-84b5-b63abb4643f4",
    "name" : "Antipasto salad",
    "type" : "Salad"
  },
  </code></pre>
  
  <p>This is my activity:</p>
  
  <pre><code>    private RecyclerView mRecycleView;
      private Query query;
      private FirebaseRecyclerOptions&lt;Meal&gt; options;
      private DatabaseReference mDatabase;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_food_list_row);
  
          mDatabase = FirebaseDatabase.getInstance().getReference().child("foods");
  
          //Recycle View
          mRecycleView = (RecyclerView) findViewById(R.id.meal_items);
          mRecycleView.setHasFixedSize(true);
          mRecycleView.setLayoutManager(new LinearLayoutManager(this));
      }
  
  
      @Override
      protected void onStart() {
          super.onStart();
  
          query = FirebaseDatabase.getInstance().getReferenceFromUrl("https://mealplanner-ec8ca.firebaseio.com/foods/AntipastoSalad");
  
          options = new FirebaseRecyclerOptions.Builder&lt;Meal&gt;()
                  .setQuery(query, Meal.class)
                  .build();
  
          FirebaseRecyclerAdapter&lt;Meal, FoodListRowActivity.MealRowHolder&gt; firebaseRecyclerAdapter = new FirebaseRecyclerAdapter&lt;Meal, FoodListRowActivity.MealRowHolder&gt;(
                  options) {
              @Override
              public FoodListRowActivity.MealRowHolder onCreateViewHolder(ViewGroup parent, int viewType) {
                  View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.food_row, parent, false);
                  return new FoodListRowActivity.MealRowHolder(v);
              }
  
              @Override
              protected void onBindViewHolder(FoodListRowActivity.MealRowHolder holder, int position, Meal current) {
                  holder.setTitle(current.getName());
                  String duration = current.getDuration() + "min";
                  holder.setDuration(duration);
              }
          };
  
          //Populate Item into Adapter
          mRecycleView.setAdapter(firebaseRecyclerAdapter);
  
          mRecycleView.addOnItemTouchListener(new RecycleViewItemClickListener(this, mRecycleView, new RecycleViewItemClickListener.OnItemClickListener() {
              @Override
              public void onItemClick(View view, int position) {
                  Intent viewMeal = new Intent(FoodListRowActivity.this, CookingInstructionActivity.class);
                  startActivity(viewMeal);
              }
  
              @Override
              public void onLongItemClick(View view, int position) {
                  //TODO: DELETE
              }
          }));
      }
  
      public static class MealRowHolder extends RecyclerView.ViewHolder {
  
          View mView;
  
          public MealRowHolder(View itemView) {
              super(itemView);
              mView = itemView;
  
          }
  
          public void setTitle(String title) {
              TextView foodTitle = (TextView) mView.findViewById(R.id.list_item_foodList_name);
              foodTitle.setText(title);
          }
  
  
          public void setDuration(String title) {
              TextView foodDuration = (TextView) mView.findViewById(R.id.list_item_foodList_calories);
              foodDuration.setText(title);
          }
      }
  }
  </code></pre>
  
  <p>and class structure:</p>
  
  <pre><code>public class Meal{
  
  private String img;
  private String duration;
  private String name;
  private String instruction;
  
  public Meal(){
  
  }
  
  public Meal (String img, String duration, String name, String instruction){
      this.img = img;
      this.name = name;
      this.duration = duration;
      this.instruction = instruction;
  }
  
  public void update(String duration, String name, String instruction)
  {
      this.name = name;
      this.duration = duration;
      this.instruction = instruction;
  }
  public String getName(){
      return name;
  }
  
  public String getDuration() {
      return duration;
  }
  
  public String getInstruction() {
      return instruction;
  }
  
  public String getImg(){return img;}
  </code></pre>