title: how to assign weight to Spinner programatically using Android without using LinearLayout?
body: <p>i have tried this code but its not dynamically setting the Spinner Weight.</p>
  
  <pre><code> &lt;Spinner
                      android:id="@+id/enterdevice_filter1"
                      android:layout_width="wrap_content"
                      android:layout_height="30dp"
                      android:layout_weight="1"
                      android:background="@drawable/dropdown_small"
                      android:drawSelectorOnTop="true" /&gt;
  
  
   LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, 
                                   LayoutParams.WRAP_CONTENT);
  spinner.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  </code></pre>
  
  <p>Inserting weight at the end of this LOC after Wrap_content braces closed gives me no result.</p>
  
  <pre><code> spinner.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  </code></pre>