Skip to content

Commit 1e9ee34

Browse files
committed
Add comments for @Result
1 parent 2d93178 commit 1e9ee34

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

  • AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations

‎AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/Result.java‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,63 @@
1+
/**
2+
* Copyright (C) 2010-2014 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+
*/
116
package org.androidannotations.annotations;
217

18+
import android.content.Intent;
19+
import android.os.Parcelable;
20+
21+
import java.io.Serializable;
322
import java.lang.annotation.ElementType;
423
import java.lang.annotation.Retention;
524
import java.lang.annotation.RetentionPolicy;
625
import java.lang.annotation.Target;
726

27+
/**
28+
* <p>
29+
* Use on any native, {@link Parcelable} or {@link Serializable} parameter of an
30+
* {@link OnActivityResult} annotated method to bind it with the value from the Intent.
31+
* </p>
32+
* <p>
33+
* The annotation value is the key used for the result data. If not set, the field name
34+
* will be used as the key.
35+
* </p>
36+
*
37+
* <blockquote>
38+
*
39+
* Some usage examples of &#064;Result annotation:
40+
*
41+
* <pre>
42+
* &#064;OnActivityResult(REQUEST_CODE)
43+
* void onResult(int resultCode, Intent data, <b>@Result String value</b>) {
44+
* }
45+
*
46+
* &#064;OnActivityResult(REQUEST_CODE)
47+
* void onResult(int resultCode, <b>@Result(value = "key") String value</b>) {
48+
* }
49+
*
50+
* &#064;OnActivityResult(REQUEST_CODE)
51+
* void onResult(<b>@Result String strVal</b>, <b>@Result int intVal</b>) {
52+
* }
53+
* </pre>
54+
*
55+
* </blockquote>
56+
*
57+
* @see android.app.Activity#onActivityResult(int, int, Intent)
58+
* @see OnActivityResult
59+
*/
60+
861
@Retention(RetentionPolicy.CLASS)
962
@Target(ElementType.PARAMETER)
1063
public @interface Result {

0 commit comments

Comments
 (0)