From 615a1ae9a71cac9a1d03ebfec876e072aa732ff1 Mon Sep 17 00:00:00 2001 From: Koji Arai Date: Mon, 28 Apr 2014 15:35:33 +0900 Subject: [PATCH] Remove duplicate code. use Utility.hasConnectivity() --- src/com/fsck/k9/fragment/MessageListFragment.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/com/fsck/k9/fragment/MessageListFragment.java b/src/com/fsck/k9/fragment/MessageListFragment.java index d4abd0b69..4dca4d7a5 100644 --- a/src/com/fsck/k9/fragment/MessageListFragment.java +++ b/src/com/fsck/k9/fragment/MessageListFragment.java @@ -1078,15 +1078,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick // Check if we have connectivity. Cache the value. if (mHasConnectivity == null) { - final ConnectivityManager connectivityManager = - (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; - } + mHasConnectivity = Utility.hasConnectivity(getActivity().getApplication()); } mLocalBroadcastManager.registerReceiver(mCacheBroadcastReceiver, mCacheIntentFilter);