¡@

Home 

2014/10/16 ¤W¤È 08:20:10

android Programming Glossary: nettype

How to handle WiFi to Mobile network switch programatically?

http://stackoverflow.com/questions/7205720/how-to-handle-wifi-to-mobile-network-switch-programatically

which is not working String networkStatus disconnected int netType 0 try ConnectivityManager connectivityManager ConnectivityManager.. if networkInfo null netType networkInfo.getType Log.d Log connetion is available else.. networkInfo.isConnected New change added here if netType ConnectivityManager.TYPE_WIFI else if netType ConnectivityManager.TYPE_MOBILE..

How to handle WiFi to Mobile network switch programatically?

http://stackoverflow.com/questions/7205720/how-to-handle-wifi-to-mobile-network-switch-programatically

automatically and vice versa. My approach is as follows which is not working String networkStatus disconnected int netType 0 try ConnectivityManager connectivityManager ConnectivityManager getSystemService Context.CONNECTIVITY_SERVICE if connectivityManager.. if connectivityManager null NetworkInfo networkInfo connectivityManager.getActiveNetworkInfo if networkInfo null netType networkInfo.getType Log.d Log connetion is available else Log.d Log connetion is not available return networkStatus.. if networkInfo.isAvailable Old one if networkInfo.isAvailable networkInfo.isConnected New change added here if netType ConnectivityManager.TYPE_WIFI else if netType ConnectivityManager.TYPE_MOBILE catch Exception e Log.d Log checkNetworkConnection..