Skip to content

Commit e2ba1ab

Browse files
committed
update @receiver JavaDoc
add information about new dataSchemes parameter
1 parent a0bcbd2 commit e2ba1ab

1 file changed

Lines changed: 35 additions & 31 deletions

File tree

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

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

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,44 +15,45 @@
1515
*/
1616
package org.androidannotations.annotations;
1717

18-
1918
import java.lang.annotation.ElementType;
2019
import java.lang.annotation.Retention;
2120
import java.lang.annotation.RetentionPolicy;
2221
import java.lang.annotation.Target;
2322

2423
/**
2524
* <p>
26-
* This annotation is intended to be used on methods of an {@link EActivity}, {@link EFragment} or {@link EService}.
27-
* When this annotation is used, a {@link android.content.BroadcastReceiver}
28-
* will be created to receive the Intent corresponding to the given actions
29-
* and it will call the annotated method.
25+
* This annotation is intended to be used on methods of an {@link EActivity},
26+
* {@link EFragment} or {@link EService}. When this annotation is used, a
27+
* {@link android.content.BroadcastReceiver} will be created to receive the
28+
* Intent corresponding to the given actions and it will call the annotated
29+
* method.
3030
* </p>
3131
* <p>
3232
* The annotated method MUST return void and MAY have one parameter:
3333
* </p>
3434
* <ul>
35-
* <li>An {@link android.content.Intent}</li>
35+
* <li>An {@link android.content.Intent}</li>
3636
* </ul>
3737
* <p>
38-
* The annotation has three parameters:
38+
* The annotation has four parameters:
3939
* </p>
4040
* <ul>
41-
* <li>
42-
* {@link #actions()}: One or several {@link java.lang.String} indicating the actions which will spark the method.
43-
* This parameter is MANDATORY
44-
* </li>
45-
* <li>
46-
* {@link #registerAt()}: The moment when the {@link android.content.BroadcastReceiver}
47-
* will be registered and unregistered. By default : OnCreate/OnDestroy.
48-
* The available values depend on the enclosing enhanced component.
49-
*
50-
* </li>
51-
* <li>
52-
* {@link #local()}: Specify whether android.support.v4.content.LocalBroadcastManager should be used.
53-
* To use android.support.v4.content.LocalBroadcastManager, you MUST have android support-v4 in your classpath.
54-
* Default value is false.
55-
* </li>
41+
* <li>
42+
* {@link #actions()}: One or several {@link java.lang.String} indicating the
43+
* actions which will spark the method. This parameter is MANDATORY</li>
44+
* <li>
45+
* {@link #dataSchemes()}: One or several {@link java.lang.String} indicating
46+
* the data schemes which should be handled.</li>
47+
* <li>
48+
* {@link #registerAt()}: The moment when the
49+
* {@link android.content.BroadcastReceiver} will be registered and
50+
* unregistered. By default : OnCreate/OnDestroy. The available values depend on
51+
* the enclosing enhanced component.</li>
52+
* <li>
53+
* {@link #local()}: Specify whether
54+
* android.support.v4.content.LocalBroadcastManager should be used. To use
55+
* android.support.v4.content.LocalBroadcastManager, you MUST have android
56+
* support-v4 in your classpath. Default value is false.</li>
5657
* </ul>
5758
*
5859
* <blockquote>
@@ -62,13 +63,19 @@
6263
* <pre>
6364
* &#064;EActivity
6465
* public class MyActivity {
65-
*
66-
* &#064;Receiver(actions={{@link android.net.wifi.WifiManager#WIFI_STATE_CHANGED_ACTION}})
66+
*
67+
* &#064;Receiver(actions = {@link android.net.wifi.WifiManager#WIFI_STATE_CHANGED_ACTION})
6768
* public void onWifiStateChanged(Intent intent);
68-
*
69-
* &#064;Receiver(actions={{@link android.net.wifi.WifiManager#WIFI_STATE_CHANGED_ACTION}}, registerAt=RegisterAt.OnResumeOnPause}
69+
*
70+
* &#064;Receiver(actions = {@link android.net.wifi.WifiManager#WIFI_STATE_CHANGED_ACTION}, registerAt = RegisterAt.OnResumeOnPause)
7071
* public void onWifiStateChangedWithoutIntent();
71-
*
72+
*
73+
* &#064;Receiver(actions = {@link android.Intent.ACTION_VIEW}, dataSchemes = "http")
74+
* public void onHttpUrlOpened(Intent intent);
75+
*
76+
* &#064;Receiver(actions = {@link android.Intent.ACTION_VIEW}, dataSchemes = {"http", "https"})
77+
* public void onHttpOrHttpsUrlOpened(Intent intent);
78+
*
7279
* }
7380
* </pre>
7481
*
@@ -88,9 +95,6 @@
8895
boolean local() default false;
8996

9097
public enum RegisterAt {
91-
OnCreateOnDestroy,
92-
OnStartOnStop,
93-
OnResumeOnPause,
94-
OnAttachOnDetach
98+
OnCreateOnDestroy, OnStartOnStop, OnResumeOnPause, OnAttachOnDetach
9599
}
96100
}

0 commit comments

Comments
 (0)