Q:

How can I submit multiple textviews to Firebase using android studio

I have an app and I want to send multiple textviews to Firebase at once.  However it only sends one textview at a time to Firebase.  For example I have the following textviews:

2 Chicken Burger
2 Kebab wrap
1 ice cream
1 biscuits
1 lamb doner

but when I submit them to Firebase, i only get this in return:

LcSw4gmPVjCS_tSM-ok foodId: 
-LcSw4gmPVjCS_tSM-ok" foodOrder: "1 Biscuits @ £1.99 = £1.99"

So only biscuits has been sent.  The other 4 textviews aren't being submitted
I tried to play around with the class constructor but cant figure it out
this is my data class
package com.example.aa1172.the_improved_almighty_project;

public class Data {

    String foodId;
    String foodOrder;

    public Data() {

    }

    public Data(String foodId, String foodOrder) {
        this.foodId = foodId;
        this.foodOrder = foodOrder;
    }

    public String getFoodId() {
        return foodId;
    }

    public String getFoodOrder() {
        return foodOrder;
    }
}

This is my code for for the data sending function, This code is inside my main activity
    public void send_data() {

        String id = dbref.push().getKey();
        String chicken = varChickenBurgerTotal.getText().toString();
        String kebab = varkebabTotal.getText().toString();
        String lamb = varLambDonerTotal.getText().toString();
        String biscuits = varBiscuitsTotal.getText().toString();
        String icecream = varIceCreamTotal.getText().toString();

        if (! TextUtils.isEmpty(chicken) || ! TextUtils.isEmpty(kebab) || ! TextUtils.isEmpty(icecream) || ! TextUtils.isEmpty(biscuits) || ! TextUtils.isEmpty(lamb)) {
            Toast.makeText(this, "Food order sent", Toast. LENGTH_LONG).show();

            // switch (! TextUtils.isEmpty(chicken) || ! TextUtils.isEmpty(kebab) || ! TextUtils.isEmpty(icecream) || ! TextUtils.isEmpty(biscuits) || ! TextUtils.isEmpty(lamb))

            if (! TextUtils.isEmpty(chicken)) {

                Data mydata = new Data(id, chicken);

                dbref.child(id).setValue(mydata);

            }

            if (! TextUtils.isEmpty(kebab)) {

                Data mydata = new Data(id, kebab);

                dbref.child(id).setValue(mydata);

            }
            if (! TextUtils.isEmpty(lamb)) {

                Data mydata = new Data(id, lamb);

                dbref.child(id).setValue(mydata);

            }
            if (! TextUtils.isEmpty(icecream)) {

                Data mydata = new Data(id, icecream);

                dbref.child(id).setValue(mydata);

            }
            if (! TextUtils.isEmpty(biscuits)) {

                Data mydata = new Data(id, biscuits);

                dbref.child(id).setValue(mydata);

            }

        } else {
            Toast.makeText(this, "No order is being sent", Toast. LENGTH_LONG).show();
        }

    }

What I need is for all textviews to be sent to the Firebase database when I click the submit button, all at the same time.  Thank you

A:

Create a data class like this. 
 public class Data {

    String chicken;
    String kebab;
    String lamb;
    String biscuits;
    String icecream;

    public Data() {

    }

    public Data(String chicken, String kebab, String lamb, String biscuits,      String icecream) {
        this.chicken = chicken;
        this.kebab = kebab;
        this.lamb= lamb;
        this.biscuits= biscuits;
        this.icecream = icecream;

    }

    //set here getter and setter method
}

and then
 public void send_data() {

   //You can validate your data here as well.  On succesfully validation
   //create new object of Data and push it frebase
   Data mydata = new Data("chicken 5 kg", "kebab 5 kg", "lamb 5 kg", "biscuit 2 pkt", "icecream 300gm")

    String id = dbref.push().getKey();
    dbref.child(id).setValue(mydata);

}

Hope this helps.