# CheckResult

Summary:[Methods](https://developer.android.com/reference/android/support/annotation/CheckResult#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/annotation/CheckResult#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/annotation/CheckResult#)  

# CheckResult

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


abstract
@interface
CheckResult
`  
`


implements

Annotation


`

|----------------------------------------|
| android.support.annotation.CheckResult |

<br />

*** ** * ** ***

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
     
<br />

## Summary

|                                                                                                                                                  ### Public methods                                                                                                                                                   ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` String` | ` `[suggest](https://developer.android.com/reference/android/support/annotation/CheckResult#suggest())`() ` Defines the name of the suggested method to use instead, if applicable (using the same signature format as javadoc.) If there is more than one possibility, list them all separated by commas. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/annotation/CheckResult#)From interface` java.lang.annotation.Annotation ` |-----------------------------------------|-------------------------| | ` abstract Class<? extends Annotation>` | ` annotationType() `    | | ` abstract boolean`                     | ` equals(Object arg0) ` | | ` abstract int`                         | ` hashCode() `          | | ` abstract String`                      | ` toString() `          | ||

## Public methods

### suggest

```
String suggest ()
```

Defines the name of the suggested method to use instead, if applicable (using the same signature format as javadoc.) If there is more than one possibility, list them all separated by commas.

For example, ProcessBuilder has a method named`redirectErrorStream()`which sounds like it might redirect the error stream. It does not. It's just a getter which returns whether the process builder will redirect the error stream, and to actually set it, you must call`redirectErrorStream(boolean)`. In that case, the method should be defined like this:  

```
  @CheckResult(suggest="#redirectErrorStream(boolean)")
  public boolean redirectErrorStream() { ... }
 
```

<br />

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |

-

  ## Annotations

  - [AnimatorRes](https://developer.android.com/reference/android/support/annotation/AnimatorRes)
  - [AnimRes](https://developer.android.com/reference/android/support/annotation/AnimRes)
  - [AnyRes](https://developer.android.com/reference/android/support/annotation/AnyRes)
  - [AnyThread](https://developer.android.com/reference/android/support/annotation/AnyThread)
  - [ArrayRes](https://developer.android.com/reference/android/support/annotation/ArrayRes)
  - [AttrRes](https://developer.android.com/reference/android/support/annotation/AttrRes)
  - [BinderThread](https://developer.android.com/reference/android/support/annotation/BinderThread)
  - [BoolRes](https://developer.android.com/reference/android/support/annotation/BoolRes)
  - [CallSuper](https://developer.android.com/reference/android/support/annotation/CallSuper)
  - [CheckResult](https://developer.android.com/reference/android/support/annotation/CheckResult)
  - [ColorInt](https://developer.android.com/reference/android/support/annotation/ColorInt)
  - [ColorLong](https://developer.android.com/reference/android/support/annotation/ColorLong)
  - [ColorRes](https://developer.android.com/reference/android/support/annotation/ColorRes)
  - [DimenRes](https://developer.android.com/reference/android/support/annotation/DimenRes)
  - [Dimension](https://developer.android.com/reference/android/support/annotation/Dimension)
  - [DrawableRes](https://developer.android.com/reference/android/support/annotation/DrawableRes)
  - [FloatRange](https://developer.android.com/reference/android/support/annotation/FloatRange)
  - [FontRes](https://developer.android.com/reference/android/support/annotation/FontRes)
  - [FractionRes](https://developer.android.com/reference/android/support/annotation/FractionRes)
  - [GuardedBy](https://developer.android.com/reference/android/support/annotation/GuardedBy)
  - [HalfFloat](https://developer.android.com/reference/android/support/annotation/HalfFloat)
  - [IdRes](https://developer.android.com/reference/android/support/annotation/IdRes)
  - [IntDef](https://developer.android.com/reference/android/support/annotation/IntDef)
  - [IntegerRes](https://developer.android.com/reference/android/support/annotation/IntegerRes)
  - [InterpolatorRes](https://developer.android.com/reference/android/support/annotation/InterpolatorRes)
  - [IntRange](https://developer.android.com/reference/android/support/annotation/IntRange)
  - [Keep](https://developer.android.com/reference/android/support/annotation/Keep)
  - [LayoutRes](https://developer.android.com/reference/android/support/annotation/LayoutRes)
  - [LongDef](https://developer.android.com/reference/android/support/annotation/LongDef)
  - [MainThread](https://developer.android.com/reference/android/support/annotation/MainThread)
  - [MenuRes](https://developer.android.com/reference/android/support/annotation/MenuRes)
  - [NavigationRes](https://developer.android.com/reference/android/support/annotation/NavigationRes)
  - [NonNull](https://developer.android.com/reference/android/support/annotation/NonNull)
  - [Nullable](https://developer.android.com/reference/android/support/annotation/Nullable)
  - [PluralsRes](https://developer.android.com/reference/android/support/annotation/PluralsRes)
  - [Px](https://developer.android.com/reference/android/support/annotation/Px)
  - [RawRes](https://developer.android.com/reference/android/support/annotation/RawRes)
  - [RequiresApi](https://developer.android.com/reference/android/support/annotation/RequiresApi)
  - [RequiresPermission](https://developer.android.com/reference/android/support/annotation/RequiresPermission)
  - [RequiresPermission.Read](https://developer.android.com/reference/android/support/annotation/RequiresPermission.Read)
  - [RequiresPermission.Write](https://developer.android.com/reference/android/support/annotation/RequiresPermission.Write)
  - [RestrictTo](https://developer.android.com/reference/android/support/annotation/RestrictTo)
  - [Size](https://developer.android.com/reference/android/support/annotation/Size)
  - [StringDef](https://developer.android.com/reference/android/support/annotation/StringDef)
  - [StringRes](https://developer.android.com/reference/android/support/annotation/StringRes)
  - [StyleableRes](https://developer.android.com/reference/android/support/annotation/StyleableRes)
  - [StyleRes](https://developer.android.com/reference/android/support/annotation/StyleRes)
  - [TransitionRes](https://developer.android.com/reference/android/support/annotation/TransitionRes)
  - [UiThread](https://developer.android.com/reference/android/support/annotation/UiThread)
  - [VisibleForTesting](https://developer.android.com/reference/android/support/annotation/VisibleForTesting)
  - [WorkerThread](https://developer.android.com/reference/android/support/annotation/WorkerThread)
  - [XmlRes](https://developer.android.com/reference/android/support/annotation/XmlRes)
-

  ## Enums

  - [RestrictTo.Scope](https://developer.android.com/reference/android/support/annotation/RestrictTo.Scope)