# TelephonyScanManager.NetworkScanCallback

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# NetworkScanCallback

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/telephony/TelephonyScanManager.NetworkScanCallback "View this page in Java")  

```
abstract class NetworkScanCallback
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                           ||
| ↳ | [android.telephony.TelephonyScanManager.NetworkScanCallback](https://developer.android.com/reference/kotlin/android/telephony/TelephonyScanManager.NetworkScanCallback#) |

The caller of[android.telephony.TelephonyManager#requestNetworkScan(android.telephony.NetworkScanRequest,java.util.concurrent.Executor,android.telephony.TelephonyScanManager.NetworkScanCallback)](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager#requestNetworkScan(android.telephony.NetworkScanRequest,%20java.util.concurrent.Executor,%20android.telephony.TelephonyScanManager.NetworkScanCallback))should implement and provide this callback so that the scan results or errors can be returned.

## Summary

|                                                                         Public constructors                                                                          ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [NetworkScanCallback](https://developer.android.com/reference/kotlin/android/telephony/TelephonyScanManager.NetworkScanCallback#NetworkScanCallback())`()` <br /> |

|                                                                                                                                                                                                                                                                     Public methods                                                                                                                                                                                                                                                                     ||
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onComplete](https://developer.android.com/reference/kotlin/android/telephony/TelephonyScanManager.NetworkScanCallback#onComplete())`()` Informs the user that the scan has stopped.                                                                                                                                                                                                                                                                                 |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](https://developer.android.com/reference/kotlin/android/telephony/TelephonyScanManager.NetworkScanCallback#onError(kotlin.Int))`(`error:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Informs the user that there is some error about the scan.                                                                                                                                                                          |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onResults](https://developer.android.com/reference/kotlin/android/telephony/TelephonyScanManager.NetworkScanCallback#onResults(kotlin.collections.MutableList))`(`results:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[CellInfo](https://developer.android.com/reference/kotlin/android/telephony/CellInfo)!>!`)` Returns the scan results to the user, this callback will be called multiple times. |

## Public constructors

### NetworkScanCallback

```
NetworkScanCallback()
```

## Public methods

### onComplete

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onComplete(): Unit
```

Informs the user that the scan has stopped. This callback will be called when the scan is finished or cancelled by the user. The related NetworkScanRequest will be deleted after this callback.  

### onError

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onError(error: Int): Unit
```

Informs the user that there is some error about the scan. This callback will be called whenever there is any error about the scan, and the scan will be terminated. onComplete() will NOT be called.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `error` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Error code when the scan is failed, as defined in[NetworkScan](https://developer.android.com/reference/kotlin/android/telephony/NetworkScan). Value is[android.telephony.NetworkScan#ERROR_MODEM_ERROR](https://developer.android.com/reference/kotlin/android/telephony/NetworkScan#ERROR_MODEM_ERROR:kotlin.Int),[android.telephony.NetworkScan#ERROR_INVALID_SCAN](https://developer.android.com/reference/kotlin/android/telephony/NetworkScan#ERROR_INVALID_SCAN:kotlin.Int),[android.telephony.NetworkScan#ERROR_MODEM_UNAVAILABLE](https://developer.android.com/reference/kotlin/android/telephony/NetworkScan#ERROR_MODEM_UNAVAILABLE:kotlin.Int),[android.telephony.NetworkScan#ERROR_UNSUPPORTED](https://developer.android.com/reference/kotlin/android/telephony/NetworkScan#ERROR_UNSUPPORTED:kotlin.Int),[android.telephony.NetworkScan#ERROR_RADIO_INTERFACE_ERROR](https://developer.android.com/reference/kotlin/android/telephony/NetworkScan#ERROR_RADIO_INTERFACE_ERROR:kotlin.Int),[android.telephony.NetworkScan#ERROR_INVALID_SCANID](https://developer.android.com/reference/kotlin/android/telephony/NetworkScan#ERROR_INVALID_SCANID:kotlin.Int), or[android.telephony.NetworkScan#ERROR_INTERRUPTED](https://developer.android.com/reference/kotlin/android/telephony/NetworkScan#ERROR_INTERRUPTED:kotlin.Int) |

### onResults

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onResults(results: MutableList<CellInfo!>!): Unit
```

Returns the scan results to the user, this callback will be called multiple times.