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.

@OnActivityResults forgets to break in the switch statement ? #465

Description

@tbruyelle

I configured my activity with 2 differents @OnActivityResults and I'm surprised that the generated code forgot the break in the switch statement...

My code :

 @OnActivityResult( CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE )
    void onCaptureImageDone( int resultCode )
    {
     ...
    }

    @OnActivityResult( CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE )
    void onCaptureVideoDone( int resultCode )
    {
     ...
    }

The generated code :

@Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        TimelineActivity_.super.onActivityResult(requestCode, resultCode, data);
        switch (requestCode) {
            case  200 :
                TimelineActivity_.this.onCaptureVideoDone(resultCode);
            case  100 :
                TimelineActivity_.this.onCaptureImageDone(resultCode);
        }
    }

Does I missed something ? I think a break is required at the end of each case... Maybe not the last, but at least for the cases before the last one !

Activity

  1. mathieuboniface commented on Jan 18, 2013

    @mathieuboniface
    Contributor

    Hi Thomas,

    Thank you for taking time to create issue on AndroidAnnotations :)

    But this bug has already been reported on #430, #427, #428, #439 and #447.

    Please look at the #427, the only thing you have to do to resolve your issue is to checkout the latest snapshot.

  2. tbruyelle commented on Jan 18, 2013

    @tbruyelle
    ContributorAuthor

    Oups sorry, I made a search on keywords like results and activity but the issues you pointed didn't pop up in the auto completion. I know now I have to go forward and launch the complete search.
    Thanks

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