Check network state in libGDX

I am looking for something similar, like this: http://stackoverflow.com/questions/2789612/how-can-i-check-whether-an-android-device-is-connected-to-the-web, but it should work also with libGDX.

Or using a codein libGDX like this for native android:

WifiManager wifi = (WifiManager) this.context.getSystemService(Context.WIFI_SERVICE);
boolean b=wifi.isWifiEnabled();

You could ping a website that’s generally always available (eg: google.com). If it times out then you don’t have a connection.

Yes, but how to implement this in a httpRequest?

http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Net.HttpRequest.html