Skip to content

Commit b341012

Browse files
Merge branch 'hotfix/2.7'
2 parents c05c8b7 + dafe6d9 commit b341012

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

AndroidAnnotations/androidannotations/src/main/java/com/googlecode/androidannotations/validation/OnActivityResultValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public boolean validate(Element element, AnnotationElements validatedElements) {
5656

5757
IsValid valid = new IsValid();
5858

59-
validatorHelper.enclosingElementHasEActivity(element, validatedElements, valid);
59+
validatorHelper.enclosingElementHasEActivityOrEFragment(element, validatedElements, valid);
6060

6161
validatorHelper.isNotPrivate(element, valid);
6262

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/**
2+
* Copyright (C) 2010-2012 eBusiness Information, Excilys Group
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed To in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.googlecode.androidannotations.test15;
17+
18+
import android.app.Fragment;
19+
import android.content.Intent;
20+
21+
import com.googlecode.androidannotations.annotations.EFragment;
22+
import com.googlecode.androidannotations.annotations.OnActivityResult;
23+
24+
@EFragment(R.layout.views_injected)
25+
public class AwaitingResultFragment extends Fragment {
26+
27+
private static final int FIRST_REQUEST = 11;
28+
private static final int SECOND_REQUEST = 22;
29+
private static final int THIRD_REQUEST = 33;
30+
31+
@OnActivityResult(FIRST_REQUEST)
32+
void onResult() {
33+
}
34+
35+
@OnActivityResult(SECOND_REQUEST)
36+
void onResultWithData(Intent intentData) {
37+
}
38+
39+
@OnActivityResult(SECOND_REQUEST)
40+
void onActivityResultWithResultCodeAndData(int result, Intent intentData) {
41+
}
42+
43+
@OnActivityResult(SECOND_REQUEST)
44+
void onActivityResultWithDataAndResultCode(Intent intentData, int result) {
45+
}
46+
47+
@OnActivityResult(THIRD_REQUEST)
48+
void onResultWithIntResultCode(int resultCode) {
49+
}
50+
51+
@OnActivityResult(THIRD_REQUEST)
52+
void onResultWithIntegerResultCode(Integer resultCodeInteger) {
53+
}
54+
55+
}

0 commit comments

Comments
 (0)