if spinner changed
<p>i want execute populateFields if the spinner changed but i don't know how i can do it.
i need anything like a onclicklistener or else</p>

<p>java:</p>

<hr>

<pre><code>            private String abfrage;


            on create:

            Spinner spinner = (Spinner) findViewById(R.id.spinnerStd);
            ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(
            this, R.array.spinnerZeitauswahl, android.R.layout.simple_spinner_item);
            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            spinner.setAdapter(adapter);

            abfrage = spinner.getSelectedItem().toString();
            populateFields();




            populateFields:

            int j = 10;
            for(int i = 0; i &lt; 5; i ++)
            {
                    if(abfrage.equals(arr[i]))//works
                    mFehlzeitText.setText(String.valueOf(j));
                    j+=10;
            }
</code></pre>
