Fix the issue of not reloading the cursor after the setting changed

This commit is contained in:
Dinu Kumarasiri 2017-05-14 14:33:19 +02:00
parent 7050efc996
commit d1fc670b19
4 changed files with 23 additions and 12 deletions

View file

@ -42,8 +42,7 @@ public class ContributionsActivity
AdapterView.OnItemClickListener,
MediaDetailPagerFragment.MediaDetailProvider,
FragmentManager.OnBackStackChangedListener,
ContributionsListFragment.SourceRefresher
{
ContributionsListFragment.SourceRefresher {
private Cursor allContributions;
private ContributionsListFragment contributionsList;
@ -92,6 +91,15 @@ public class ContributionsActivity
@Override
protected void onResume() {
super.onResume();
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
boolean isSettingsChanged =
sharedPreferences.getBoolean(Prefs.IS_CONTRIBUTION_COUNT_CHANGED,false);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(Prefs.IS_CONTRIBUTION_COUNT_CHANGED,false);
editor.apply();
if(isSettingsChanged){
refreshSource();
}
}
@Override