spinner is giving me an error , i am not able to resolve it
<p>Here is code!when i run this. It gives errors in logcat. I have provided logcat below.Please check! Help me how to resolve this error.</p>

<pre><code>Spinner spinner1 = (Spinner) findViewById(R.id.spinner1);

//error 1//
spinner1.setOnItemSelectedListener(this); 

List&lt;String&gt; list = new ArrayList&lt;String&gt;();
list.add("Automobile");
list.add("Business Services");
list.add("Computers");
list.add("Education");
list.add("Personal");
list.add("Travel");

//error2//
ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, list); 

dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner1.setAdapter(dataAdapter);
</code></pre>

<p>**i am getting an error which i am not able to solve on my own . i need help regarding these errors **</p>

<p><strong>errors</strong></p>

<pre><code>1.(85, 37) error: method setOnItemSelectedListener in class AdapterView&lt;T&gt; cannot be applied to given types;
required: OnItemSelectedListener
found: &lt;anonymous OnClickListener&gt;
reason: actual argument &lt;anonymous OnClickListener&gt; cannot be converted to OnItemSelectedListener by method invocation conversion
where T is a type-variable:
T extends Adapter declared in class AdapterView

2.Error:(95, 64) error: no suitable constructor found for ArrayAdapter(&lt;anonymous OnClickListener&gt;,int,List&lt;String&gt;)
constructor ArrayAdapter.ArrayAdapter(Context,int,int,List&lt;String&gt;) is not applicable
(actual and formal argument lists differ in length)
constructor ArrayAdapter.ArrayAdapter(Context,int,List&lt;String&gt;) is not applicable
(actual argument &lt;anonymous OnClickListener&gt; cannot be converted to Context by method invocation conversion)
constructor ArrayAdapter.ArrayAdapter(Context,int,int,String[]) is not applicable
(actual and formal argument lists differ in length)
constructor ArrayAdapter.ArrayAdapter(Context,int,String[]) is not applicable
(actual argument &lt;anonymous OnClickListener&gt; cannot be converted to Context by method invocation conversion)
constructor ArrayAdapter.ArrayAdapter(Context,int,int) is not applicable
(actual argument &lt;anonymous OnClickListener&gt; cannot be converted to Context by method invocation conversion)
constructor ArrayAdapter.ArrayAdapter(Context,int) is not applicable
(actual and formal argument lists differ in length)
</code></pre>

<p><strong><em>here is the code of onClickListner</em></strong></p>

<pre><code>button.setOnClickListener(
            new Button.OnClickListener() {

                public void onClick(View view) {

                    CheckBox yes = (CheckBox) findViewById(R.id.yes);
                    CheckBox no = (CheckBox) findViewById(R.id.no);
                    EditText ageText = (EditText) findViewById(R.id.ageText);
                    EditText editText = (EditText) findViewById(R.id.editText);
                    EditText editText3 = (EditText) findViewById(R.id.editText3);


                    String name = editText.getText().toString();


                    if (yes.isChecked()) {
                        int age = Integer.parseInt(ageText.getText().toString());
                        int c;
                        c = age - 7;
                        int z;
                        z = 2016 + c;

                        editText3.setText((name + " you might die in the year " + z) + "");

                    } else if (no.isChecked()) {
                        int age = Integer.parseInt(ageText.getText().toString());
                        int c;

                        c = age + 10;
                        int z;
                        z = 2016 + c;
                        editText3.setText((name + " you might die in the year " + z) + "");
</code></pre>