PTBR (Spinner) Firebase Exception: Found conflicting getters for name: getAdapter

0

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) {

        }
    });
    
asked by anonymous 20.04.2017 / 19:39

1 answer

0

You are switching from View Spinner to Firebase. In order to pass the value obtained from Spinner:

objetoRef.child("carrinho").child("spinnercarrinho").setValue(spinnercarrinho.getSelectedItem().toString());
    
24.02.2018 / 12:16