Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/telephony/NetworkScan#constants) \| [Methods](https://developer.android.com/reference/android/telephony/NetworkScan#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/telephony/NetworkScan#inhmethods)

# NetworkScan

*** ** * ** ***

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


`
public


class
NetworkScan
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telephony.NetworkScan |

<br />

*** ** * ** ***

The caller of
`https://developer.android.com/reference/android/telephony/TelephonyManager#requestNetworkScan(android.telephony.NetworkScanRequest,%20java.util.concurrent.Executor,%20android.telephony.TelephonyScanManager.NetworkScanCallback)`
will receive an instance of `https://developer.android.com/reference/android/telephony/NetworkScan`, which contains a callback method
`https://developer.android.com/reference/android/telephony/NetworkScan#stopScan()` for stopping the in-progress scan.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/telephony/NetworkScan#ERROR_INTERRUPTED` The scan has been interrupted by another scan with higher priority. |
| `int` | `https://developer.android.com/reference/android/telephony/NetworkScan#ERROR_INVALID_SCAN` The parameters of the scan is invalid. |
| `int` | `https://developer.android.com/reference/android/telephony/NetworkScan#ERROR_INVALID_SCANID` The scan ID is invalid. |
| `int` | `https://developer.android.com/reference/android/telephony/NetworkScan#ERROR_MODEM_ERROR` The scan has failed due to some modem errors. |
| `int` | `https://developer.android.com/reference/android/telephony/NetworkScan#ERROR_MODEM_UNAVAILABLE` The modem can not perform the scan because it is doing something else. |
| `int` | `https://developer.android.com/reference/android/telephony/NetworkScan#ERROR_RADIO_INTERFACE_ERROR` The RIL returns nothing or exceptions. |
| `int` | `https://developer.android.com/reference/android/telephony/NetworkScan#ERROR_UNSUPPORTED` The modem does not support the request scan. |
| `int` | `https://developer.android.com/reference/android/telephony/NetworkScan#SUCCESS` The RIL has successfully performed the network scan. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/telephony/NetworkScan#stopScan()() ` Stops the network scan Use this method to stop an ongoing scan. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### ERROR_INTERRUPTED

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

```
public static final int ERROR_INTERRUPTED
```

The scan has been interrupted by another scan with higher priority.

<br />

Constant Value:

10002
(0x00002712)


### ERROR_INVALID_SCAN

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

```
public static final int ERROR_INVALID_SCAN
```

The parameters of the scan is invalid.

<br />

Constant Value:

2
(0x00000002)


### ERROR_INVALID_SCANID

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

```
public static final int ERROR_INVALID_SCANID
```

The scan ID is invalid. The user is either trying to stop a scan which does not exist
or started by others.

<br />

Constant Value:

10001
(0x00002711)


### ERROR_MODEM_ERROR

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

```
public static final int ERROR_MODEM_ERROR
```

The scan has failed due to some modem errors.

<br />

Constant Value:

1
(0x00000001)


### ERROR_MODEM_UNAVAILABLE

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

```
public static final int ERROR_MODEM_UNAVAILABLE
```

The modem can not perform the scan because it is doing something else.

<br />

Constant Value:

3
(0x00000003)


### ERROR_RADIO_INTERFACE_ERROR

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

```
public static final int ERROR_RADIO_INTERFACE_ERROR
```

The RIL returns nothing or exceptions.

<br />

Constant Value:

10000
(0x00002710)


### ERROR_UNSUPPORTED

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

```
public static final int ERROR_UNSUPPORTED
```

The modem does not support the request scan.

<br />

Constant Value:

4
(0x00000004)


### SUCCESS

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

```
public static final int SUCCESS
```

The RIL has successfully performed the network scan.

<br />

Constant Value:

0
(0x00000000)


## Public methods

### stopScan

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

```
public void stopScan ()
```

Stops the network scan

Use this method to stop an ongoing scan. When user requests a new scan, a `https://developer.android.com/reference/android/telephony/NetworkScan`
object will be returned, and the user can stop the scan by calling this method.

<br />