When i am using wifi network all is working fine ,,but when i turn off all network(Not Airplance mode) and turn on 3G HotSpot th开发者_如何转开发en my application is not even detecting connection.So web service shwoing timeout errors.
ConnectivityManager cm = (ConnectivityManager)getSystemService
(Context.CONNECTIVITY_SERVICE);;
boolean 3GCon=cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnected()
This returning always false
Why not try using isAvailable() instead of isConnected()?
It's very difficult to give you an exact answer as to why it's not working for you, but as a start I suggest you look through an example such as this ConnectivityManagerTestActivity and compare it with your own code.
精彩评论