android.support.annotation.CheckResult |
Denotes that the annotated method returns a result that it typically is an error to ignore. This is usually used for methods that have no side effect, so calling it without actually looking at the result usually means the developer has misunderstood what the method does.
Example:
public @CheckResult String trim(String s) { return s.trim();
...
s.trim(); // this is probably an error
s = s.trim(); // ok
}
[Expand]
Inherited Methods | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
java.lang.annotation.Annotation
|
Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.
Android 6.0 r1 —
* Required Fields
You have successfully signed up for the latest Android developer news and tips.