Enable synchronization on pull-to-refresh

This commit is contained in:
M66B 2019-02-14 18:18:41 +00:00
parent 8f4b4c5385
commit be5f9697bc
1 changed files with 10 additions and 0 deletions

View File

@ -487,6 +487,16 @@ public class FragmentMessages extends FragmentBase {
args.putLong("folder", folder);
new SimpleTask<Boolean>() {
@Override
protected void onPreExecute(Bundle args) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean enabled = prefs.getBoolean("enabled", true);
if (!enabled) {
prefs.edit().putBoolean("enabled", true).apply();
ServiceSynchronize.reload(getContext(), "refresh");
}
}
@Override
protected Boolean onExecute(Context context, Bundle args) {
long fid = args.getLong("folder");