Tuesday, 15 September 2015

Clear the selected value from android spinner -


Check once Czech box will then spin the show will once Czech box to hide the spinner is unchecked. I have shown that combination in the image below

Enter image details here

I have achieved using this down I showed address

  halfHalfCB.setOnClickListener (new View.OnClickListener () {public void onClick (View v) {if (halfHalfCB.isChecked ()) {extraDescriptionHalfSP.setVisibility (View.VISIBLE); textview.setVisibility (View.VISIBLE);} else {extraDescriptionHalfSP.setVisibility (View.GONE); textview.setVisibility (View.GONE) ;! // string extraDescriptionHalf = extraDescriptionHalfSP // .getSelectedItem () = null extraDescriptionHalfSP // .getSelectedItem () .toString (): null; // extraDescriptionHalf = null;}}}); !? AddToCartButton.setOnClickListener (New View.OnClickListener () {public void onClick (View v) {try {String extraDescriptionHalf = extraDescriptionHalfSP .getSelectedItem () = null extraDescriptionHalfSP .getSelectedItem () toString () :. null;  

in fact my problem once Czech goes to Czech box and then user Czech box to select a value and user then uncontrolled spin. I distinctly selected values ​​from the spinner (or selected value zero ) How do I like ? My current code carries the selected items from the spinner.

Any help will be highly appreciated.

I think you can do it like this:

  ... else {extraDescriptionHalfSP.setVisibility (View.GONE); extraDescriptionHalfSP.setSelection (- 1); Textview.setVisibility (View.GONE); ...  

No comments:

Post a Comment