No text is being set once I select an Item on an Android spinner.
<p>No text is being set when I select any item from a spinner. What might be the error?</p>

<pre><code>    ArrayAdapter&lt;String&gt; pSelectAdapter =  new ArrayAdapter&lt;String&gt;(PCreate.this,android.R.layout.simple_spinner_item, pNames);
    pSelectAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    selectP.setAdapter(pSelectAdapter);



    selectP.setOnItemSelectedListener(new OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,
            int arg2, long arg3) {
        // TODO Auto-generated method stub
        String nameSelected = pNames.get(arg2);
        pID = pMatch.get(nameSelected);
        p.setText(nameSelected);

        }

        @Override
        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
        // TODO Auto-generated method stub

        }



    });
</code></pre>
