@@ -0,0 +1,1323 @@
+package com.andela.voluminotesapp.fragments;%0A%0A%0Aimport android.content.SharedPreferences;%0Aimport android.os.Handler;%0Aimport android.preference.PreferenceManager;%0Aimport android.support.v4.app.Fragment;%0A%0Aimport com.andela.voluminotesapp.R;%0Aimport com.andela.voluminotesapp.callbacks.AutoSaveCallback;%0A%0Aimport java.util.Timer;%0Aimport java.util.TimerTask;%0A%0A%0Apublic abstract class AutoSaveFragment extends Fragment %7B%0A    private long setTime = 0;%0A    private AutoSaveCallback callback;%0A%0A    Timer timer;%0A    public void autoSave(final AutoSaveCallback callback)%7B%0A        setTime = getSetTime();%0A        if (setTime != 0) %7B%0A            this.callback = callback;%0A            timer = new Timer();%0A            timer.scheduleAtFixedRate(new TimerTask() %7B%0A                @Override%0A                public void run() %7B%0A                    callback.onSave();%0A                %7D%0A            %7D, 0, setTime);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void onDestroy() %7B%0A        if (setTime != 0) %7B%0A            timer.cancel();%0A            callback = null;%0A        %7D%0A        super.onDestroy();%0A    %7D%0A%0A    private long getSetTime()%7B%0A        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getContext());%0A        return Long.parseLong(sharedPreferences.getString(getString(R.string.autosave), %220%22));%0A    %7D%0A%7D%0A

Refactor AutoSaave Fragment