@Override
 public void onResume() {
   super.onResume();
   updateView();
   updateOptionsMenu();
   if (mApplications != null) {
     mApplications.resume(mSortOrder);
     mApplications.updateLoading();
   }
 }
 public void resume(int sortOrder) {
   if (mApplications != null) {
     mApplications.resume(sortOrder);
   }
   if (mRunningProcessesView != null) {
     boolean haveData = mRunningProcessesView.doResume(mOwner, mRunningProcessesAvail);
     if (haveData) {
       mRunningProcessesView.setVisibility(View.VISIBLE);
       mLoadingContainer.setVisibility(View.INVISIBLE);
     } else {
       mLoadingContainer.setVisibility(View.VISIBLE);
     }
   }
 }
 private void selectView(int which) {
   if (which == VIEW_LIST) {
     if (mResumedRunning) {
       mRunningProcessesView.doPause();
       mResumedRunning = false;
     }
     if (mCurView != which) {
       mRunningProcessesView.setVisibility(View.GONE);
       mListContainer.setVisibility(View.VISIBLE);
       mLoadingContainer.setVisibility(View.GONE);
     }
     if (mActivityResumed) {
       mApplicationsAdapter.resume(mFilterApps, mSortOrder);
     }
   } else if (which == VIEW_RUNNING) {
     if (!mCreatedRunning) {
       mRunningProcessesView.doCreate(null);
       mRunningProcessesView.mAdapter.setShowBackground(mShowBackground);
       mCreatedRunning = true;
     }
     boolean haveData = true;
     if (mActivityResumed && !mResumedRunning) {
       haveData = mRunningProcessesView.doResume(this, mRunningProcessesAvail);
       mResumedRunning = true;
     }
     mApplicationsAdapter.pause();
     if (mCurView != which) {
       if (haveData) {
         mRunningProcessesView.setVisibility(View.VISIBLE);
       } else {
         mLoadingContainer.setVisibility(View.VISIBLE);
       }
       mListContainer.setVisibility(View.GONE);
     }
   }
   mCurView = which;
   final Activity host = getActivity();
   if (host != null) {
     host.invalidateOptionsMenu();
   }
 }