M
M
McMike2017-06-09 08:44:13
Java
McMike, 2017-06-09 08:44:13

How to make several selects with a choice from one array of values?

There is a form with field matching, for each field you need to select a value from an array of values, and for each field the value must be unique. Is there a way to do this without much effort?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor, 2018-10-13
@RATlius

You can use it as EVGENY T suggests.
You can immediately pass it to the class where you will use it:

public void n_ot() {
        num_of_tr.get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
            @Override
            public void onSuccess(DocumentSnapshot documentSnapshot) {
                if (documentSnapshot.exists()) {
                    //String amount_not = documentSnapshot.getString(AMOUNT);
                    //anotherClass.setAmountNot(amount_not);
                    anotherClass.setAmountNot(documentSnapshot.getString(AMOUNT));
                }
            }
        });
    }

public class AnotherClass{
    String amount_not;
    //...
    public void setAmounntNot(String value){
        this.amount_not = value;
    }
    //...
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question