I was using spinner in a TableRow and it was working perfectly well, except that I do not know the spinner icon is pulling out, according to the selected item, I tried to remove the spinner section in XML and made it on my code.
To create a spinner in the ():
selectAirya = / / (spinner) this.findViewById (RID spinner); / New spinner (this); String [] ss = getResources (). GetStringArray (R.array.countries); ArrayAdapter & LT; String & gt; Adapter = new array adapter & lt; String & gt; (This, android.R.layout.simple_spinner_item, ss); Adapter.setDropDownViewResource (android.R.layout.simple_spinner_dropdown_item); Spinner.setAdapter (adapter); SelectArea.setOnItemSelectedListener (New MyOnItemSelectedListener ()); SelectArea.setSelection (prefInt); To conduct a selection event: The public class applies MyOnItemSelectedListener OnItemSelectedListener {public void onItemSelected (AdapterView & lt ;? & gt; parent, view view, int pos, long id ) {Log D. (Tag, "On-IMified (" + ID); } Nothing selected at the public zero (adapterview ? Gt; parent} {// do nothing}} This works almost right to touch TableRow TableRow Does not show any spinner icon, it pops up to select the item. My only problem is that, upon choosing a timer, I never got selected on my name .. .. what could be wrong is?
Please change this line
spinner.setAdapter (adapter) ; In line
selected array adapter (adapter);
Comments
Post a Comment