mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
Remove duplicate code. use Utility.hasConnectivity()
This commit is contained in:
parent
51aa34d52b
commit
615a1ae9a7
@ -1078,15 +1078,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
|||||||
|
|
||||||
// Check if we have connectivity. Cache the value.
|
// Check if we have connectivity. Cache the value.
|
||||||
if (mHasConnectivity == null) {
|
if (mHasConnectivity == null) {
|
||||||
final ConnectivityManager connectivityManager =
|
mHasConnectivity = Utility.hasConnectivity(getActivity().getApplication());
|
||||||
(ConnectivityManager) getActivity().getApplication().getSystemService(
|
|
||||||
Context.CONNECTIVITY_SERVICE);
|
|
||||||
final NetworkInfo netInfo = connectivityManager.getActiveNetworkInfo();
|
|
||||||
if (netInfo != null && netInfo.getState() == NetworkInfo.State.CONNECTED) {
|
|
||||||
mHasConnectivity = true;
|
|
||||||
} else {
|
|
||||||
mHasConnectivity = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mLocalBroadcastManager.registerReceiver(mCacheBroadcastReceiver, mCacheIntentFilter);
|
mLocalBroadcastManager.registerReceiver(mCacheBroadcastReceiver, mCacheIntentFilter);
|
||||||
|
Loading…
Reference in New Issue
Block a user