Using spinner OnItemSelectedListener() to start new intent
<p>I have a spinner and when the user selects I want to call another java class using new Intent. The code below worked when I was using a Button but now I have it attached to the Spinner select I think it has something to do with view.getContext();</p>

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

<pre><code>        public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,
                int arg2, long arg3) {
            int item = areaspinner.getSelectedItemPosition();

       Intent myIntent = new Intent(view.getContext(), ShowXMLPAR.class);
       startActivityForResult(myIntent, 0);
        }

        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
        }

});
</code></pre>

<p>Can anyone help me update this part of the code.</p>
