Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy does my android spinner display the radio button in the textview?
    primarykey
    data
    text
    <p>i have a spinner with an arrayadapter that is dynamically managed. when it gets displayed, the spinner text also displays the radio button. how do i get rid of this radio button? the drop down arrow is all strecthed and yucky... thats my problem. NOTE: i'm not talking about the radio buttons that appear in the list that is displayed when i select the drop down on the spinner.</p> <p>here are the appropriate code snippet... couple of points:</p> <ul> <li>this code is in the constructor of widget which is a subclass of Spinner</li> <li>value is an array of Object instances (passed when the widget gets created)</li> <li>there are no XML resources; all widgets are dynamically created</li> <li>thinking i need to "manipulate" the prompt, i added setPrompt(...) in the constructor and also in the onitemclicked event listener... this had no effect.</li> </ul> <p>Q: what am i missing? seems to me i'm missing some attribute of the Spinner which is causing the radio button to also display in the text part of the spinner.</p> <p>-- snip code -- </p> <pre><code>public class ChoiceGroupImpl extends Spinner implements OnItemSelectedListener { public ChoiceGroupImpl(Activity activity, WidgetContainer container, Value widget, AttributeImpl attributes, Object[] value, int selected) { ... adapter = new ArrayAdapter&lt;CharSequence&gt;(activity, R.layout.simple_spinner_dropdown_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); for (int i = 0; i &lt; value.length; i++) adapter.add(value[i].toString()); if (attributes.isReadonly()) setEnabled(false); setAdapter(adapter); setSelection(selected); setPrompt(adapter.getItem(selected)); setOnItemSelectedListener(this); ... } public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) { setPrompt(adapter.getItem(position)); ((ToolkitImpl) Toolkit.getInstance()).hiddenCommand(container, "SelectionChanged"); } ... </code></pre> <p>-- end snip code --</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload