I am making an application where I choose a number in the spinner and write that number in Firebase. is giving the following error:
detailsaboutspinnerandhowIamwritingtofirebase
spinnercarrinho=(Spinner)findViewById(R.id.spinner_carrinho);//CreateanArrayAdapterusingthestringarrayandadefaultspinnerlayoutArrayAdapter<CharSequence>adapter=ArrayAdapter.createFromResource(this,R.array.carrinho_string,android.R.layout.simple_spinner_item);//Specifythelayouttousewhenthelistofchoicesappearsadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);//Applytheadaptertothespinnerspinnercarrinho.setAdapter(adapter);spinnercarrinho.setOnItemSelectedListener(newAdapterView.OnItemSelectedListener(){@OverridepublicvoidonItemSelected(AdapterView<?>parent,Viewview,intposition,longid){objetoRef.child("carrinho").child("spinnercarrinho").setValue(spinnercarrinho);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});