title: I can't understand the error: "void is an invalid type for the variable"
body: <p>I was searching and can't find what does the error mean in my code:</p>
  
  <pre><code>import android.os.Bundle;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.AdapterView.OnItemSelectedListener;
  import android.widget.ArrayAdapter;
  import android.widget.RadioButton;
  import android.widget.Spinner;
  import android.widget.TextView;
  import android.app.Activity;
  
  public class MainActivity extends Activity {
  
  public class function implements OnItemSelectedListener {
  
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; parent, View arg1, int pos,
              long id) {
          // TODO Auto-generated method stub
  
          String str=parent.getItemAtPosition(pos).toString();
          text.setText(str);
  
      }
  
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
          // TODO Auto-generated method stub
  
      }
  
  }
  
  Spinner spinner;
  TextView text;
  TextView fruta;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      spinner = (Spinner)findViewById(R.id.spinner1);
      text = (TextView)findViewById(R.id.textView1);
      ArrayAdapter&lt;CharSequence&gt; adapter=ArrayAdapter.createFromResource(this, R.array.spinnerarray, android.R.layout.simple_spinner_item);
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      spinner.setAdapter(adapter);
      spinner.setOnItemSelectedListener(new function());
      fruta = (TextView)findViewById(R.id.textView3);
      fruta.setEnabled(false);
  
  
  public void frutaSelecionada (View view); {
  
      boolean cheked = ((RadioButton) view).isChecked();
      switch (view.getId())
        {
          case R.id.radioButton1:
          if(cheked)
          {
              fruta.setText("Maçã");
              fruta.setEnabled(true);
          }
          else
          {
              fruta.setEnabled(false);
          }
          break;
          case R.id.radioButton2:
          if(cheked)
              {
                  fruta.setText("Laranja");
                  fruta.setEnabled(true);
              }
              else
              {
                  fruta.setEnabled(false);
              }
              break;
          case R.id.radioButton3:
          if(cheked)
              {
                  fruta.setText("Uvas");
                  fruta.setEnabled(true);
              }
              else
              {
                  fruta.setEnabled(false);
              }
              break;
  
        }
  
  }
  
  
  }
  }
  </code></pre>
  
  <p>The error is: "void is an invalid type for the variable frutaSelecionada"</p>
  
  <p>If you know any site that explains something I appreciated.</p>
  
  <p>Thanks.</p>