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.

@OnActivityResult to process Intent extras #796

Description

@tobias-

When receiving a reply back via @OnActivityResult it would be great if you could annotate the result with @Result or something similar and get the variables as the response. E.g.:

@OnActivityResult(OtherActivity.REQUEST_CODE)
void response(int resultCode, @Result(OtherActivity.ID) String id) {
...
}

This is an improvement on #28.

Another solution would be for the IntentBuilder to have get-methods for retrieving the value out of the intent with the correct type. E.g.:

@OnActivityResult(OtherActivity.REQUEST_CODE)
void response(int resultCode, Intent resultIntent) {
String id = OtherActivity_.IntentBuilder.create(resultIntent).getId();
}

Activity

  1. DayS commented on Dec 6, 2013

    @DayS
    Contributor

    Seems interesting. We could add both versions and use the latter one in the implementation of the first.

    I'm planning it for 3.1.

  2. naixx commented on Dec 10, 2013

    @naixx
    Contributor

    👍 for @Result
    On the second approach, how should this IntenBuilder be generated? Based on @Extra?

  3. tobias- commented on Dec 25, 2013

    @tobias-
    Author

    Yes, that was my idea. I don't know if the result Intent should be the same/use the same names/variables as the starting Intent, so maybe it should be completely different, i.e. use a different annotation and different factory class. I have no opinion as to what is best.

    I've started implementation of @Result, but don't expect a patch any time soon (or maybe at all) because it's my first time with codemodel and I'm stuck trying to get Eclipse configured without using a 2nd Eclipse.

  4. modified the milestones: Someday, 3.1 on May 11, 2014
  5. dodgex commented on Nov 10, 2014

    @dodgex
    Member

    this can be closed.

  6. WonderCsabo commented on Nov 10, 2014

    @WonderCsabo
    Member

    Thanks, indeed.

    This was implemented.

  7. modified the milestones: 3.2, Someday on Nov 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions