You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
OptionsMenu and OptionsItem with library project #258
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.
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.
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.
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.
@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.
Activity
pyricau commentedon Jul 2, 2012
Damn. So when does this happen exactly ? When you do a "project clean" ? When you open eclipse ?
fc1943s commentedon Jul 2, 2012
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.
pyricau commentedon Jul 3, 2012
Did you change the package of
SherlockActivity?fc1943s commentedon Jul 3, 2012
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.
pyricau commentedon Jul 3, 2012
The only explanation I'd have is that the
SherlockActivitymight not be in the compile path when the generated class is wrongly compiled... strange, because then it should generate an error.naixx commentedon Jul 16, 2012
Facing the same problem with non library project. 2.7-SNAPSHOT
Regenerating this specific source by editing activity java file fixes the problem.
naixx commentedon Jul 19, 2012
Noticed that this error happens with activities, that inherit generated activities_
pyricau commentedon Aug 2, 2012
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
@EActivitythat extends SherlockActivity ?naixx commentedon Aug 2, 2012
@pyricau, here is a sample structure https://github.com/naixx/OptionsItemBug. I get this problem on clean. If you modify
AbstractOptionsActivityand save it(simple regenerate) - the problem disappears.fc1943s commentedon Aug 2, 2012
My structure:
@EActivity
public class MenuActivity extends BaseActivity_ {}
@EActivity
public abstract class BaseActivity extends OvfBaseActivity_ {}
@EActivity
public abstract class OvfBaseActivity extends SherlockActivity {}
Merge pull request #283 from excilys/278_annotations_on_supertypes
miguelangellv commentedon Sep 6, 2012
Dou you use com.actionbarsherlock.view.Menu or android.view.Menu?
You must use com.actionbarsherlock.view.Menu
pyricau commentedon Sep 7, 2012
Hello @miguelangellv . We use one or the other, depending on whether the class inherits from SherlockActivity or not :)