List of usage examples for android.net NetworkInfo isAvailable
@Deprecated public boolean isAvailable()
From source file:org.brandroid.openmanager.activities.OpenExplorer.java
public boolean isNetworkConnected() { ConnectivityManager conman = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); if (!conman.getBackgroundDataSetting()) return false; NetworkInfo ni = conman.getActiveNetworkInfo(); if (ni == null) return false; if (!ni.isAvailable() || !ni.isConnected()) return false; if (ni.getState() == State.CONNECTING) return false; return true;/*w ww .ja v a2 s.c o m*/ }