简体   繁体   中英

Android Studio Java : Cannot resolve symbol override

I'm a beginner with Java and Android Studio. I try to implemet a OnEditorActionListener that listens for when the user presses the Done button in a softkeyboard. There are many code fragments available, but I dont know where to put the code (onCreate ? Own class...) While testing some of those code fragments I get an error "Cannot resolve symbol override", see screenshot. I've found some articles about "cannot resolve symbol xy", but nothing about "override"

So my question is: Why do I get "Cannot resolve symbol override" here ?

overrideError

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.frm_main_layout);

    //txtMeineZahl.setOnEditorActionListener(new classDoneOnEditorActionListener());  //doesnt work so far..OK for now

    EditText txtMeineZahl = (EditText) findViewById(R.id.txtMeineZahl);
    txtMeineZahl.setOnEditorActionListener(new TextView.OnEditorActionListener()
    {
        @override    ---- ERROR here
        public boolean onEditorAction(TextView view, int action,KeyEvent arg2event)
        {
            if (action == EditorInfo.IME_ACTION_DONE)
            {
                //view.setFocusable(false);
               Toast.makeText(getApplicationContext(),"test",Toast.LENGTH_LONG);
            }
            return false;
        }
    });
}

It should be @Override not @override. O must be capital in @Override.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM