Hi everyone,
I am currently using a book that was published using Android SDK
0.8(or something earlier).

I am trying to create a sample menu, but then my eclipse complains
about the menu.add function. Under all the add, eclipse underlines in
red with the following error:
"The method add(int, int, int, CharSequence) in the type Menu is not
applicable for the arguments (int, int, String)" for each of the
menu.add in my code.

I have looked at the sample code given by google and that's how they
do it too.

What is wrong here? Why is eclipse mistaking the charsequences for
Strings?




package android_programmers_guide.AndroidViews;

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, "AutoComplete");
        menu.add(0,1, "AutoComplete");
        menu.add(0,2, "AutoComplete");
        menu.add(0,3, "AutoComplete");
        menu.add(0,4, "AutoComplete");
        menu.add(0,5, "AutoComplete");
        return true;
    }

}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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