Update Spinner value when activity is open?
<p>Hii i have a thread that runs and retrieve values for the spinnner from the server till then the spinnner is empty how can i update the values of the spinner when i get the values ..and my activity is open at that time. </p>

<pre><code>ArrayList valforspinner=new ArrayList();

new Thread(new Runnable() {
            public void run() {         
        valforspinner= GetList.List(myPrefs.getString("IP", ""));
        adapter.notifyDataSetChanged();
            }}).start();


    spinner = (Spinner) findViewById(R.id.Spinner01);
     adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item, Printers);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(adapter);
</code></pre>
