package info.nightscout.androidaps.plugins.Common;

import android.support.v4.app.Fragment;

import butterknife.Unbinder;
import info.nightscout.androidaps.MainApp;

abstract public class SubscriberFragment extends Fragment {
    protected Unbinder unbinder;

    @Override
    public void onPause() {
        super.onPause();
        MainApp.bus().unregister(this);
    }

    @Override
    public void onResume() {
        super.onResume();
        MainApp.bus().register(this);
        updateGUI();
    }

    @Override public void onDestroyView() {
        super.onDestroyView();
        if (unbinder != null)
            unbinder.unbind();
    }


    protected abstract void updateGUI();
}

@@ -519,24 +519,37 @@
 ride public 
+synchronized 
 void onDestr

synchronize onDestroyView