package org.edx.mobile.base;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import org.edx.mobile.event.NewRelicEvent;

import de.greenrobot.event.EventBus;
import roboguice.fragment.RoboFragment;

public class BaseFragment extends RoboFragment {
    private boolean isFirstVisit;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EventBus.getDefault().post(new NewRelicEvent(getClass().getSimpleName()));
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        isFirstVisit = true;
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public void onResume() {
        super.onResume();
        if (isFirstVisit) {
            isFirstVisit = false;
        } else {
            onRevisit();
        }
    }

    /**
     * Called when a Fragment is re-displayed to the user (the user has navigated back to it).
     * Defined to mock the behavior of {@link Activity#onRestart() Activity.onRestart} function.
     */
    protected void onRevisit() {
    }
}

@@ -81,145 +81,8 @@
 dle;
-%0Aimport android.support.annotation.Nullable;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;
 %0A%0Aim
@@ -282,16 +282,23 @@
 rstVisit
+ = true
 ;%0A%0A    @
@@ -400,24 +400,24 @@
 anceState);%0A
+
         Even
@@ -498,272 +498,8 @@
  %7D%0A%0A
-    @Nullable%0A    @Override%0A    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) %7B%0A        isFirstVisit = true;%0A        return super.onCreateView(inflater, container, savedInstanceState);%0A    %7D%0A%0A
     

Fix 'onRevisit' callback calls wrongly issue.