Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Cannot override the final method from SherlockActivity"

Tags:

android

Am trying to extend my activity with Actionbarsherlock , When i did this i'm getting an error

"Cannot override the final method from SherlockActivity"

My activity has these imports

    import java.io.IOException;
    import com.actionbarsherlock.app.SherlockActivity;
    import android.os.Bundle;
    import android.accounts.Account;
    import android.accounts.AccountManager;
    import android.accounts.AccountManagerCallback;
    import android.accounts.AccountManagerFuture;
    import android.accounts.AuthenticatorException;
    import android.accounts.OperationCanceledException;
    import android.app.Activity;
    import android.content.Intent;
    import android.util.Log;
    import android.view.Menu;
    import android.view.View;
    import android.widget.Button;

Kindly guide me how to resolve it?

like image 886
Mufrah Avatar asked Oct 11 '12 08:10

Mufrah


1 Answers

The correct answer is to import the ActionBarSherlock classes, instead of the standard Android ones.

This is from the front page of the ActionBarSherlock project, so obviously this is a common issue:

Imports

In order to provide functionality that was not available on version of Android prior to 3.0, the library includes and uses a lot of classes that are named the same as their native counterparts. The three most common are:

com.actionbarsherlock.app.ActionBar
com.actionbarsherlock.view.Menu
com.actionbarsherlock.view.MenuItem
com.actionbarsherlock.view.MenuInflater
like image 158
Booger Avatar answered Sep 28 '22 05:09

Booger