content: package com.knight.arch.ui.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 com.knight.arch.module.Injector;
  
  
  /**
   * @author andyiac
   * @date 15-9-16
   * @web http://blog.andyiac.com
   * @github https://github.com/andyiac
   */
  public class InjectableFragment extends BaseFragment {
      boolean injected = false;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          return super.onCreateView(inflater, container, savedInstanceState);
      }
  
      @Override
      public void onActivityCreated(@Nullable Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
      }
  
      @Override
      public void onAttach(Activity activity) {
          super.onAttach(activity);
          if (!injected) {
              injected = true;
              Injector injector = (Injector) getActivity();
              injector.inject(this);
          }
      }
  }
  