johannilsson / android-actionbar

DEPRECATED Android Action Bar Implementation
1.31k stars 564 forks source link

missing: actionbar_item_home #26

Closed LorneLaliberte closed 13 years ago

LorneLaliberte commented 13 years ago

Latest version of mimic-native-api generates several errors in ActionBar.java.

    mHomeView = (FrameLayout) mBarView.findViewById(R.id.actionbar_home_view);

    // ...

    public Action findAction(int itemId) {
        if (itemId == R.id.actionbar_item_home) {
        // ...

    // etc.

actionbar_item_home is missing from the resources.

johannilsson commented 13 years ago

That id is defined within ids.xml and should be merged to the main application resources during build time.

Sorry to ask but is it initialized correct as a library project?

LorneLaliberte commented 13 years ago

Thanks, I didn't spot that change...I'll see if I can get it working at my end.

BTW, yes, as far as I can tell it's being used correctly as a library; the method I'm using has worked fine up until the latest pull.

Whenever a new version of the library is available, I pull the changes, and then manually copy the source tree into another repository, delete the .git folder and .gitignore file, and restart eclipse. (I didn't want to mess around with sub-repositories after reading about many problems with them.)

The project is already configured as a library in Eclipse, and has remained so after every update so far. My own project is still correctly referencing the android-actionbar libary project in its properties as well.

LorneLaliberte commented 13 years ago

Ok, got it to work by forcing com/markupartist/android/widget/actionbar/R.java to reload. (I edited it within eclipse and forced it to regenerate...for some reason I need to do this occasionally to force Eclipse to recognize changes to files in library projects when Refresh doesn't. It seems to work fine until there's a syntax error in a library, then it gets "stuck" on the error state for some reason and does not refresh.)

Sorry for the false issue report, thanks for the quick response though Johan!

johannilsson commented 13 years ago

Happy to hear that it's working now. It could be a bit messy to setup a library project sometimes, whenever you do a change within the library project you also need to make sure that all resources are regenerated typically by a refresh on the main project. I really hope support for library projects will be improved in future updates.

LorneLaliberte commented 13 years ago

Yeah, I've had similar issues with other library projects, including our own internal projects we've had set up. It's somewhat sporadic, and a refresh on either project doesn't do the trick; but I've switched to using "Project > Clean" in those cases which seems to work. (Which is another way of forcing the autogeneration to occur.)