Code example for NetworkInfo

Methods: isAvailable

0
                return null; 
            } 
 
            // Resolve timezone 
            NetworkInfo activeNetworkInfo = mConnMgr.getActiveNetworkInfo(); 
            if (activeNetworkInfo != null && activeNetworkInfo.isAvailable()) { 
                mHasNetworkAvailable = true; 
                mTZ = resolveTimeZone(); 
            } 
 
            return null; 
        } 
 
        @Override 
        protected void onPostExecute(Void result) { 
            if (isCancelled()) { 
                return; 
            } 
            if (mCity == null || (mHasNetworkAvailable && mTZ == null)) { 
                if (mCallback != null) { 
                    mCallback.onCityAndTimeZoneLocateError();