package R.helper;

import android.app.Activity;
import android.support.v4.app.Fragment;

/**
 * Created by duynk on 1/4/16.
 */
public class BaseFragment extends Fragment {
    public BaseFragment() {
        super();
    }

    public <T extends BaseActivity> T getActivityRef(Class<T> cls) {
        Activity act = this.getActivity();
        if (act != null && (act instanceof BaseActivity)) {
            return (T)act;
        }
        return null;
    }

    public void onResumeFromBackStack() {}
}

@@ -41,16 +41,86 @@
 tivity;%0A
+import android.os.Bundle;%0Aimport android.support.annotation.Nullable;%0A
 import a
@@ -517,32 +517,469 @@
 rn null;%0A    %7D%0A%0A
+    public static %3CT extends BaseFragment%3E T newInstance(Class%3CT%3E clazz) %7B%0A        return BaseFragment.newInstance(clazz, null);%0A    %7D%0A%0A    public static %3CT extends BaseFragment%3E T newInstance(Class%3CT%3E clazz, @Nullable Bundle b) %7B%0A        try %7B%0A            T s = (T) clazz.newInstance();%0A            s.setArguments(b == null?new Bundle():b);%0A            return s;%0A        %7Dcatch (Exception E) %7B%0A            return null;%0A        %7D%0A    %7D%0A%0A
     public void 

add fragment util