how to get position from Spinner adapter
<p>i fill spinner with generic Arraylist of cat Categeory type </p>

<p>now i want to get position of Specific Item from it , i try code below but it always return S</p>

<p>if (Singleton.getCategory() != null)
        {</p>

<pre><code>        cat item =new cat();
        String cat= Singleton.getCategory().toString();
        int catid=  Singleton.getCategoryid();

        item.setName(cat);
        item.setcatId(catid);

        int spinnerPosition=selcategaryadapter.getPosition(item);



        //set the default according to value
        selCategary.setSelection(spinnerPosition);
    }
</code></pre>

<p>here is how i fill spinner </p>

<pre><code> JSONArray jsonarray=JSONFunction.getJSONCategary();    
    JSONObject json1=null;

    ArrayList&lt;eexit&gt; listCategory= new ArrayList&lt;eexit&gt;();

    try {
        for(int i=0;i&lt; jsonarray.length();i++)
        {
            json1=jsonarray.getJSONObject(i);
        arrayCategary[i]=json1.getString("Name")

            cat item=new cat();  
            item.setName(json1.getString("Name"));
            item.setcatId(Integer.parseInt(json1.getString("CategoryID")));
            listCategory.add(item);

        }

    } catch (Exception e) {
        // TODO: handle exception
    }

      ArrayAdapter&lt;eexit&gt; selcategaryadapter = new ArrayAdapter&lt;eexit&gt;(Activity.this,R.layout.spinner_layout, listCategory);

      selcategaryadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);                                  
      selCategary.setAdapter(selcategaryadapter);
      selCategary.setPrompt("Select Category");
</code></pre>
