Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try like this:</p> <pre><code>private Spinner status; status = (Spinner) findViewById(R.id.status); final ArrayList&lt;Simplestatus&gt; statusList = new ArrayList&lt;Simplestatus&gt;(); Simplestatus tempstatus = new Simplestatus(); tempstatus.setSimpleStatusName("ZERO"); tempstatus.setSimpleStatusValue("0"); Simplestatus tempstatus1 = new Simplestatus(); tempstatus1.setSimpleStatusName("ONE"); tempstatus1.setSimpleStatusValue("1"); statusList.add(tempstatus); statusList.add(tempstatus1); SpinnerAdapter stateAdaptor = new SpinnerAdapter(SettingActivity.this,statusList); // stateList.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); status.setAdapter(stateAdaptor); status.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,int position, long arg3) { changeStatus(statusList.get(position)); selected = statusList.get(position).getsimpleStatusName(); System.out.println("selected"+selected); } public void onNothingSelected(AdapterView&lt;?&gt; arg0) { } }); public class Simplestatus { private String simpleStatusName; private String simpleStatusValue; public String getSimpleStatusName() { return simpleStatusName; } public void setSimpleStatusName(String simpleStatusName) { this.simpleStatusName = simpleStatusName; } public String getsimpleStatusValue() { return simpleStatusValue; } public void setsimpleStatusValue(String simpleStatusValue) { this.simpleStatusValue = simpleStatusValue; } } </code></pre>
    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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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