Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8185731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:57:01+00:00 2026-06-07T01:57:01+00:00

Possible Duplicate: Why do I get must override a superclass method with @Override? I

  • 0

Possible Duplicate:
Why do I get “must override a superclass method” with @Override?

I recently installed the latest Android SDK in a new eclipse set up on a new machine. When I brought over an old project in several places I got a syntax error concerning @Override stating “method suchandsuch of type suchandsuch must override a superclass method”. These items were fixed by removing @Override (which I don’t think is correct).

I just made my first new project with my new setup and the initial untouched code is giving this error which has me confused.

package com.geeksonhugs.whenimclose;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.NavUtils;
import android.view.MenuItem;

public class ItemListActivity extends FragmentActivity
        implements ItemListFragment.Callbacks {

    private boolean mTwoPane;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_item_list);

        if (findViewById(R.id.item_detail_container) != null) {
            mTwoPane = true;
            ((ItemListFragment) getSupportFragmentManager()
                    .findFragmentById(R.id.item_list))
                    .setActivateOnItemClick(true);
        }
    }

    @Override
    public void onItemSelected(String id) {
        if (mTwoPane) {
            Bundle arguments = new Bundle();
            arguments.putString(ItemDetailFragment.ARG_ITEM_ID, id);
            ItemDetailFragment fragment = new ItemDetailFragment();
            fragment.setArguments(arguments);
            getSupportFragmentManager().beginTransaction()
                    .replace(R.id.item_detail_container, fragment)
                    .commit();

        } else {
            Intent detailIntent = new Intent(this, ItemDetailActivity.class);
            detailIntent.putExtra(ItemDetailFragment.ARG_ITEM_ID, id);
            startActivity(detailIntent);
        }
    }
}

The compiler accepts @Override before onCreate but gives the error with onItemSelected. Can someone please clarify what is going on for me please? Again this syntax error does not occur in prior versions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:57:03+00:00Added an answer on June 7, 2026 at 1:57 am

    I think you are using java compiler 1.5, make it 1.6,because @Override of interface's methods is introduced after 1.5.

    In Eclipse,

    Window -> Preferences -> Java -> Compiler -> Compiler Compliance Level -> select
    1.6

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Why do I get error: … must be a reference type in
Possible Duplicate: Android - get path of resource I need to know the string
Possible Duplicate: Get and Parse CSV file in android I would like to store
Possible Duplicate: Android ListView, start new activity Hey can someone tell me how I
Possible Duplicate: Get variable name. javascript “reflection” Is there a way to know the
Possible Duplicate: Get file name from URI string in C# How to extract file
Possible Duplicate: Get the resolution of a jpeg image using C# and the .NET
Possible Duplicate: Get the IP Address of local computer Obtaining local IP address using
Possible Duplicate: Get all files from VSS for a given date? I need to
Possible Duplicate: Get a list of dates between two dates This is my sql:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.