List of usage examples for android.net NetworkInfo getDetailedState
@Deprecated
public @NonNull DetailedState getDetailedState()
From source file:com.newsrob.EntryManager.java
public boolean isNetworkConnected(Context ctx) { if (connectivityManager == null) connectivityManager = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo ni = connectivityManager.getActiveNetworkInfo(); if (ni == null) { PL.log("EntryManager. Wasn't able to get NI.", ctx); return false; }//from ww w.java2 s . c om if (NewsRob.isDebuggingEnabled(ctx)) { PL.log("ActiveNetwork: " + ni.getTypeName(), ctx); PL.log("ActiveNetworkState: " + ni.getDetailedState(), ctx); PL.log("isNetworkConnected? " + ni.isConnected(), ctx); } return ni.isConnected(); }
From source file:com.grazerss.EntryManager.java
public boolean isNetworkConnected(Context ctx) { if (connectivityManager == null) { connectivityManager = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); }//from w ww . j av a 2s . c o m NetworkInfo ni = connectivityManager.getActiveNetworkInfo(); if (ni == null) { PL.log("EntryManager. Wasn't able to get NI.", ctx); return false; } if (NewsRob.isDebuggingEnabled(ctx)) { PL.log("ActiveNetwork: " + ni.getTypeName(), ctx); PL.log("ActiveNetworkState: " + ni.getDetailedState(), ctx); PL.log("isNetworkConnected? " + ni.isConnected(), ctx); } return ni.isConnected(); }