0
I am making an application where I choose a number in the spinner and write that number in Firebase. this giving the following error:
details about the spinner and how I’m recording in firebase
spinnercarrinho = (Spinner) findViewById(R.id.spinner_carrinho);
// Create an ArrayAdapter using the string array and a default spinner layout
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.carrinho_string, android.R.layout.simple_spinner_item);
// Specify the layout to use when the list of choices appears
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner
spinnercarrinho.setAdapter(adapter);
spinnercarrinho.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
objetoRef.child("carrinho").child("spinnercarrinho").setValue(spinnercarrinho);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});