Want able to see full data after calling the function
<p>In the below code i got the value from the database and display in the spinner.And on click of the value in spinner some data must be display but my problem is it display only last row of the data. If you help me it would my pleasure.</p>

<p>SpSites.setOnItemSelectedListener(new OnItemSelectedListener() {        </p>

<pre><code>   public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,int arg2, long arg3) {
        Object itemName = SpSites.getSelectedItem();
        String strselectedName = itemName.toString();

            for(int i = 0; i &lt; siteName.length; i++){
                if(siteName[i].equalsIgnoreCase(strselectedName)){
                    detailEmployee = gd.selectPhoneDirectory(siteId[i]);//detailEmployee is string array
                    //Toast.makeText(Directory.this,detailEmployee[i], Toast.LENGTH_LONG).show();           

                }
                for(int j = 0;j&lt;detailEmployee.length;j++){
                    Toast.makeText(Directory.this,detailEmployee[j], Toast.LENGTH_LONG).show();
                    System.out.println("Data :"+detailEmployee[j]);
                }
            }
        }
</code></pre>
