Example usage for android.net ConnectivityManager bindProcessToNetwork

List of usage examples for android.net ConnectivityManager bindProcessToNetwork

Introduction

In this page you can find the example usage for android.net ConnectivityManager bindProcessToNetwork.

Prototype

public boolean bindProcessToNetwork(@Nullable Network network) 

Source Link

Document

Binds the current process to network .

Usage

From source file:com.mobilyzer.util.PhoneUtils.java

public void unregisterNetworkCallback() {
    if (connectivityNetworkCallback != null) {
        ConnectivityManager cm = ((ConnectivityNetworkCallback) connectivityNetworkCallback)
                .getConnectivityManager();
        cm.bindProcessToNetwork(null);
        cm.unregisterNetworkCallback(connectivityNetworkCallback);
        connectivityNetworkCallback = null;
    }//from  w ww  .  j a  va 2  s.c  om
}