Constantin Jacob
Constantin Jacob

Reputation: 528

onOptionsItemSelected syntax error

I'm having problems setting up the responder for the actionbar menu.

I'm using this code and Eclipse keeps telling me "Syntax error on token " . ", delete this token" and "The method startActiviy(intent) is undefined for the type MainActivity"

This is my code:

public boolean onOptionsItemSelected (MenuItem item) {
        switch (item.getItemId()) {
        case.R.Id.about:
            startActivity (new Intent (this, einstellungen.class));
            return true;

            default:
                return super.onOptionsItemSelected(item);
        }

        return true;

    }

Does anyone have an idea?

Thanks in advance!

Upvotes: 0

Views: 140

Answers (1)

Michał Z.
Michał Z.

Reputation: 4119

It's this line:

case.R.Id.about:

it should be:

case R.Id.about:

Upvotes: 2

Related Questions