Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

OptionsMenu and OptionsItem with library project #258

Description

@fc1943s

Error: "Cannot override the final method from SherlockActivity"

My library project does the Sherlock library bind, and my main project binds the library one.

Ex:
ActionBarSherlock > MyLibraryProject > MyMainProject

When i use @optionsmenu and @OptionsItem on any activity of MyMainProject, AA import the wrong Menu and MenuItems.

My current solution is to delete the generated activities with errors, and then they are generated properly. (I have to do this on every modification). Must be the processing order or something.

Version: 2.7-SNAPSHOT

Thank you.

Activity

  1. pyricau commented on Jul 2, 2012

    @pyricau
    Contributor

    Damn. So when does this happen exactly ? When you do a "project clean" ? When you open eclipse ?

  2. fc1943s commented on Jul 2, 2012

    @fc1943s
    Author

    On every "save" of my files. (With build automatically enabled)
    But I just ignore the "errors" and delete the generated activities only when I "run" the app.

  3. pyricau commented on Jul 3, 2012

    @pyricau
    Contributor

    Did you change the package of SherlockActivity ?

  4. fc1943s commented on Jul 3, 2012

    @fc1943s
    Author

    Nope.
    import com.actionbarsherlock.app.SherlockActivity;

    Note that both of projects (Main and Library) are linked with AA.
    I've done some tests now, binding ActionBarSherlock with MyMainProject too, and the error continues. The error only happens when i change code of MyLibraryProject.

  5. pyricau commented on Jul 3, 2012

    @pyricau
    Contributor

    The only explanation I'd have is that the SherlockActivity might not be in the compile path when the generated class is wrongly compiled... strange, because then it should generate an error.

  6. naixx commented on Jul 16, 2012

    @naixx
    Contributor

    Facing the same problem with non library project. 2.7-SNAPSHOT
    Regenerating this specific source by editing activity java file fixes the problem.

  7. naixx commented on Jul 19, 2012

    @naixx
    Contributor

    Noticed that this error happens with activities, that inherit generated activities_

  8. pyricau commented on Aug 2, 2012

    @pyricau
    Contributor

    Interesting @naixx . Is it your abstract class that uses @OptionsItem / @OptionsMenu, or the subclass ?

    Does this happen when you do a "Project > Clean" ? Which file do you "edit" to fix the problem ? Could you be more precise please ? Thank you.

    @stewunknown did you also use an abstract @EActivity that extends SherlockActivity ?

  9. naixx commented on Aug 2, 2012

    @naixx
    Contributor

    @pyricau, here is a sample structure https://github.com/naixx/OptionsItemBug. I get this problem on clean. If you modify AbstractOptionsActivity and save it(simple regenerate) - the problem disappears.

  10. fc1943s commented on Aug 2, 2012

    @fc1943s
    Author

    My structure:

    @EActivity
    public class MenuActivity extends BaseActivity_ {}

    @EActivity
    public abstract class BaseActivity extends OvfBaseActivity_ {}

    @EActivity
    public abstract class OvfBaseActivity extends SherlockActivity {}

  11. added a commit that references this issue on Aug 10, 2012
    762ed4c
  12. miguelangellv commented on Sep 6, 2012

    @miguelangellv

    Dou you use com.actionbarsherlock.view.Menu or android.view.Menu?

    You must use com.actionbarsherlock.view.Menu

  13. pyricau commented on Sep 7, 2012

    @pyricau
    Contributor

    Hello @miguelangellv . We use one or the other, depending on whether the class inherits from SherlockActivity or not :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions