add the following import:
import android.view.MenuItem;

you should also change the parameter on your switch to
item.getItemId()

On Oct 27, 6:14 pm, disappearedng <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I am encountering the following error from eclipse:
>
> The method onOptionsItemSelected(MenuItem) of type AndroidViews must
> override or implement a supertype method
>
> import android.app.Activity;
> import android.os.Bundle;
> import android.view.Menu;
>
> public class AndroidViews extends Activity {
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
>     }
>
>     @Override
>     public boolean onCreateOptionsMenu(Menu menu)       {
>         super.onCreateOptionsMenu(menu);
>         menu.add(0, 0, 0, "AutoComplete");
>         menu.add(0, 1, 1, "Button");
>         menu.add(0, 2, 2, "CheckBox");
>         menu.add(0, 3, 3, "EditText");
>         menu.add(0, 4, 4, "RadioGroup");
>         menu.add(0, 5, 5, "Spinner");
>
>         return super.onCreateOptionsMenu(menu);
>     }
>
>     @Override
>     public boolean onOptionsItemSelected(MenuItem item) { //ECLIPSE
> STARTS COMPLAINING HERE
>
>             switch (item.getId())       {
>             case 0:
>                 return super.onOptionsItemSelected(item);
>             case 1:
>                 return super.onOptionsItemSelected(item);
>             case 2:
>                 return super.onOptionsItemSelected(item);
>             case 3:
>                 return super.onOptionsItemSelected(item);
>             case 4:
>                 return super.onOptionsItemSelected(item);
>             case 5:
>                 return super.onOptionsItemSelected(item);
>             }
>     }
>
> }
>
> I tried to google for an answer for "The method
> onOptionsItemSelected(MenuItem) of type AndroidViews must override or
> implement a supertype" method but there isn't any lead
>
> What gives/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to