# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Constants | Ctors | Methods | Inherited Methods

# RangingResultCallback

`public abstract class RangingResultCallback`
`extends Object` ``

java.lang.Object
↳ | android.net.wifi.rtt.RangingResultCallback

Base class for ranging result callbacks. Should be extended by applications and set when calling `WifiRttManager#startRanging(RangingRequest, java.util.concurrent.Executor, RangingResultCallback)`. If the ranging operation fails in whole (not attempted) then `onRangingFailure(int)` will be called with a failure code. If the ranging operation is performed for each of the requested peers then the `onRangingResults(java.util.List)` will be called with the set of results (@link `RangingResult`, each of which has its own success/failure code `RangingResult#getStatus()`.

## Summary

### Constants
`int` | `STATUS_CODE_FAIL` A failure code for the whole ranging request operation.
`int` | `STATUS_CODE_FAIL_RTT_NOT_AVAILABLE` A failure code for the whole ranging request operation.

### Public constructors
`RangingResultCallback()`

### Public methods
`abstract void` | `onRangingFailure(int code)` Called when a ranging operation failed in whole - i.e.
`abstract void` | `onRangingResults(List<RangingResult> results)` Called when a ranging operation was executed.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### STATUS_CODE_FAIL

    public static final int STATUS_CODE_FAIL

A failure code for the whole ranging request operation. Indicates a failure.

Constant Value: 1 (0x00000001)

### STATUS_CODE_FAIL_RTT_NOT_AVAILABLE

    public static final int STATUS_CODE_FAIL_RTT_NOT_AVAILABLE

A failure code for the whole ranging request operation. Indicates that the request failed due to RTT not being available - e.g. Wi-Fi was disabled. Use the `WifiRttManager#isAvailable()` and `WifiRttManager#ACTION_WIFI_RTT_STATE_CHANGED` to track RTT availability.

Constant Value: 2 (0x00000002)

## Public constructors

### RangingResultCallback

    public RangingResultCallback ()

## Public methods

### onRangingFailure

    public abstract void onRangingFailure (int code)

Called when a ranging operation failed in whole - i.e. no ranging operation to any of the devices specified in the request was attempted.

Parameters
`code` | `int`: A status code indicating the type of failure. Value is `STATUS_CODE_FAIL`, or `STATUS_CODE_FAIL_RTT_NOT_AVAILABLE`

### onRangingResults

    public abstract void onRangingResults (List<RangingResult> results)

Called when a ranging operation was executed. The list of results corresponds to devices specified in the ranging request.

Parameters
`results` | `List`: List of range measurements, one per requested device. This value cannot be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*