Now maybe Marton will figure it out, he was, after all, the person who asked the question. But I cannot figure out how to tell whether the phone is connected to the Internet from NetworkInfo, not even from the more detailed version, 'NetworkInfo.DetailedState'
Rather, the questions this object answers are just a little different: on the Wifi net, it tells you when you have a 802.11 connection, on the phone network, it tells you when the phone network is idle/ connected/disconnected. But I see no way to differentiate between, say for example, 802.11 MAC level connectivity and 'Internet', which has to mean at least IP if not TCP level connectivity. After all: the text does say, "Describes the status of a network interface of a given type (currently either Mobile or Wifi)". Both of these interfaces can return CONNECTED without any connection to the Internet being available. Hopefully, that is not too common in the Mobile case, but it certainly is common in the WiFi case: it is distressingly frequent that you have connectivity to the local net, or even to the local access point -- and no further. Now maybe this is good enough for Marton. But the question he originally asked was about "Internet connectivity", which really is different. On Nov 15, 9:13 am, Smelly Eddie <[email protected]> wrote: > You can use ConnectivityManager and check the returned networkinfo > object. > > http://developer.android.com/reference/android/net/NetworkInfo.html > > On Nov 15, 4:32 am, Marton Kodok <[email protected]> wrote: > > > Hello, > > > I want to detect if there is a connection to Internet before launching a > > webview. > > How can I detect it? > > > -- > > Márton -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en

