title: How to get the text of item from spinner in android
body: <p>i am trying to fetch the item text from my spinner view by matching a name but not able to do yet.Here is the code i have used : </p>
  
  <pre><code>for(int i=0;i&lt;calendar_spinner.getAdapter().getCount();i++) {
             String s= calendar_spinner.getAdapter().getItem(i).toString();
             System.out.println("Calendars are"+s);
             if(calendar_Name.equals(s))
           { 
            System.out.println("Calendar setted");
            calendar_spinner.setSelection(i); 
            break;
           }
  }
  </code></pre>
  
  <p>and i am getting the output for s as com.android.calendermodel.MyCalendarsModel@405872a0 Not exactly the name, something different...</p>