Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Commit

Permalink
CleanerFragment: Remove unnecessary OnSharedPreferenceChangeListener
Browse files Browse the repository at this point in the history
  • Loading branch information
lubo committed Dec 29, 2014
1 parent 7f09247 commit c01c778
Showing 1 changed file with 1 addition and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
import java.util.ArrayList;
import java.util.List;

public class CleanerFragment extends Fragment implements CleanerService.OnActionListener,
SharedPreferences.OnSharedPreferenceChangeListener {
public class CleanerFragment extends Fragment implements CleanerService.OnActionListener {

private LinearColorBar mColorBar;
private TextView mSystemSizeText;
Expand Down Expand Up @@ -229,20 +228,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}

@Override
public void onStart() {
mSharedPreferences.registerOnSharedPreferenceChangeListener(this);

super.onStart();
}

@Override
public void onStop() {
mSharedPreferences.unregisterOnSharedPreferenceChangeListener(this);

super.onStop();
}

@Override
public void onResume() {
updateStorageUsage();
Expand Down Expand Up @@ -333,22 +318,6 @@ private void showProgressBar(boolean show) {
}
}

@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (mCleanerService != null && !mCleanerService.isScanning() &&
!mCleanerService.isCleaning()) {
if (key.equals(mSortByKey)) {
String filter = "";

if (isAdded() && mSearchView != null && mSearchView.isShown()) {
filter = mSearchView.getQuery().toString();
}

mAppsListAdapter.sortAndFilter(getSortBy(), filter);
}
}
}

@Override
public void onScanStarted(Context context) {
if (isAdded()) {
Expand Down

0 comments on commit c01c778

Please sign in to comment.