Android Spinner is working — but can't parse and pass the selected value?

Perhaps I'm missing something in your question, but when you select the value for the Toast, you could just set the value of a private member, then read this value in your onClick, (being as you know you're getting the correct value in the onItemSelected) private String countrySelection; public void onItemSelected(AdapterView country0, View view, int pos, long id) { countrySelection = country0. GetItemAtPosition(pos).toString(); Toast. MakeText(country0.getContext(), "The country is " + countrySelection, Toast.

LENGTH_LONG).show(); } ... final String country = countrySelection; setPassword. SetOnClickListener(new View.OnClickListener(){ public void onClick(View v) { sendDataToServer(country, ...) Does this solve your issue? Edit What type is country0 in this context?(I don't have comment privileges yet) final String country = country0;///MAYBE THIS IS WHAT IS WRONG.

Perhaps I'm missing something in your question, but when you select the value for the Toast, you could just set the value of a private member, then read this value in your onClick, (being as you know you're getting the correct value in the onItemSelected) private String countrySelection; public void onItemSelected(AdapterView country0, View view, int pos, long id) { countrySelection = country0. GetItemAtPosition(pos).toString(); Toast. MakeText(country0.getContext(), "The country is " + countrySelection, Toast.

LENGTH_LONG).show(); } ... final String country = countrySelection; setPassword. SetOnClickListener(new View.OnClickListener(){ public void onClick(View v) { sendDataToServer(country, ...); Does this solve your issue? Edit... What type is country0 in this context?(I don't have comment privileges yet) final String country = country0;///MAYBE THIS IS WHAT IS WRONG.

I was just about to write up pretty much the same suggestion. This is pretty much how I handle the Spinner in my application and it works flawlessly. – Klaus Mar 23 at 15:34 country value still the only one coming up NULL.

Tried a few diff ways. This is what it is now: final String country1 = countrySelection; setPassword. SetOnClickListener(new View.OnClickListener(){ public void onClick(View v) { String userName = mUserNameEditText.getText().toString(); String userId = uid; String over_35 = ""; more code............ } else acctinfo(country1, userName, email0, strPassword1, userType, over_35, userId); – artworthy Mar 23 at 20:38 1 Ok ... kept fooling with it and got it to work.

Thanks! – artworthy Mar 23 at 21:10.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions