Note that there are some explanatory texts on larger screens.

plurals
  1. POMethod...Must Override a Superclass Method (Latest SDK)
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/8697513/why-do-i-get-must-override-a-superclass-method-with-override">Why do I get “must override a superclass method” with @Override?</a> </p> </blockquote> <p>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).</p> <p>I just made my first new project with my new setup and the initial untouched code is giving this error which has me confused.</p> <pre><code>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); } } } </code></pre> <p>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?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload