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.

Use @Extra in an @EService annotated IntentService #466

Closed

Description

@erickok

IntentServices make it easy to handle the execution of commands through the catching of Intents. AndroidAnnotations have a very helpful @Extra annotation for Activitys to inject into fields the extra Bundle found attached to an Intent. Unfortunately, AndroidAnnotations does not support the @Extra annotation in @eservice annotated classes, only in @EActivity classes.

Please add support for @Extra in @EService annotated classes.

Activity

  1. dodgex commented on Nov 10, 2014

    @dodgex
    Member

    i'm not 100% sure but i think, this issue can be closed as there is @EIntentService and @ServiceAction that allow this. https://github.com/excilys/androidannotations/wiki/Enhance-IntentServices

  2. WonderCsabo commented on Nov 10, 2014

    @WonderCsabo
    Member

    That is not the same, also we removed the extra methods for @ServiceAction (#1214).

  3. dodgex commented on Nov 10, 2014

    @dodgex
    Member

    i'm not using intentservice or @ServiceAction so i cant test. but how would you now put extras to the ServiceAction call?

    the current version of the wiki allows this

    @ServiceAction
        void myAction(String param) {
            // ...
        }
    

    is this feature gone? or how to set the extras?

  4. WonderCsabo commented on Nov 10, 2014

    @WonderCsabo
    Member

    Before that PR, we created a named method for each action parameter. Now we just call IntentBuilder.extra in the action method of the generated IntentBuilder. Please see #1070 for details. Also you can inspect MyIntentService_ in the test suite.

  5. dodgex commented on Nov 10, 2014

    @dodgex
    Member

    @WonderCsabo ok. imo this still can be closed. sure, this issue wants to have @Extra for @EService (used on IntentService) but what is the goal of having this?

    Getting easy access to the extra data for the calling intent.

    What feature does @ServiceAction provide? correct. getting easy access to the extra data for the calling intent.

    you get what i mean? i think using @ServiceAction is even better than having the extra data in class member.

  6. removed this from the Someday milestone on Nov 10, 2014
  7. WonderCsabo commented on Nov 10, 2014

    @WonderCsabo
    Member

    I agree this can be closed. @DayS's PR had a bigger scope.

  8. erickok commented on Nov 10, 2014

    @erickok
    Author

    Feel free to close this issue. When I opened it the @ServiceAction annotation did not yet exist and indeed this implements the feature that I requested.

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions