Reputation: 61
i develop this app , in the main activity i check the internet connection as the following :
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
LoaderManager loaderManager = getSupportLoaderManager();
loaderManager.initLoader(1, null, this);
}
when i go to HOURLY
activity i check the internet in the same way like above on the onCreate()
method.
my question when i open the main activity i disconnect the internet and go to HOURLY
activity to handle "no internet exception" but networkInfo.isConnected() in HOURLY
activity return true
why the internet still connect???
Upvotes: 1
Views: 1093