@Override public void onAttach(Context context) { super.onAttach(context); mContext = context; }
@Override public void onAttach(Context context) { super.onAttach(context); activity = (AppCompatActivity) context; }
@Override public void onAttach(Activity activity){ super.onAttach(activity); this.mContext = activity; }
@Override public void onAttach(Activity activity) { super.onAttach(activity); this.activity = (FragmentActivity) activity; }
public void onAttach(Context context) { super.onAttach(context); if (context instanceof Activity) { listener = (Listener) context; } }
@Override public void onAttach(Activity activity){ super.onAttach(activity); this.mContext = activity; }
@Override public void onAttach(Activity activity){ super.onAttach(activity); this.mContext = activity; }
public void onAttach(Context context) { super.onAttach(context); if (context instanceof Activity) { listener = (Listener) context; } }
@Override public void onAttach(Context context) { super.onAttach(context); try { callback = (UCropFragmentCallback) context; } catch (ClassCastException e) { throw new ClassCastException(context.toString() + " must implement UCropFragmentCallback"); } }
@Override public void onAttach(Context context) { super.onAttach(context); if (context instanceof OnFragmentInteractionListener) { mListener = (OnFragmentInteractionListener) context; } else { throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener"); } }
@Override public void onAttach(Activity a) { super.onAttach(a); Log.d(getClass().getSimpleName(), "onAttach()"); }
@Override public void onAttach(Activity a) { super.onAttach(a); Log.d(getClass().getSimpleName(), "onAttach()"); }
@Override public void onAttach(Context context) { super.onAttach(context); try { registerFragmentWithRoot(getActivity()); } catch (IllegalStateException e) { // OnAttach can be called after the activity is destroyed, see #497. if (Log.isLoggable(TAG, Log.WARN)) { Log.w(TAG, "Unable to register fragment with root", e); } } }
@Override public void onAttach(Activity host) { super.onAttach(host); router=MediaRouter.getInstance(host); }
@Override public void onAttach(Activity host) { super.onAttach(host); EventBus.getDefault().register(this); if (app==null) { app=host.getApplicationContext(); new FetchQuestionsThread().start(); } }
@Override public void onAttach (Activity activity) { if (activity instanceof Callbacks) { this.callbacks = (Callbacks)activity; } else if (getParentFragment() instanceof Callbacks) { this.callbacks = (Callbacks)getParentFragment(); } else if (getTargetFragment() instanceof Callbacks) { this.callbacks = (Callbacks)getTargetFragment(); } else { throw new RuntimeException( "Missing AndroidFragmentApplication.Callbacks. Please implement AndroidFragmentApplication.Callbacks on the parent activity, fragment or target fragment."); } super.onAttach(activity); }
@Override public void onAttach (Activity activity) { if (activity instanceof Callbacks) { this.callbacks = (Callbacks)activity; } else if (getParentFragment() instanceof Callbacks) { this.callbacks = (Callbacks)getParentFragment(); } else if (getTargetFragment() instanceof Callbacks) { this.callbacks = (Callbacks)getTargetFragment(); } else { throw new RuntimeException( "Missing AndroidFragmentApplication.Callbacks. Please implement AndroidFragmentApplication.Callbacks on the parent activity, fragment or target fragment."); } super.onAttach(activity); }
@Override public void onAttach(Activity activity) { if (!(activity instanceof Listener)) { throw new IllegalStateException("Activity must implement fragment Listener."); } super.onAttach(activity); TodoApp.getComponent(activity).inject(this); setHasOptionsMenu(true); listener = (Listener) activity; adapter = new ListsAdapter(activity); }
@Override public void onAttach(Activity activity) { if (!(activity instanceof Listener)) { throw new IllegalStateException("Activity must implement fragment Listener."); } super.onAttach(activity); TodoApp.getComponent(activity).inject(this); setHasOptionsMenu(true); listener = (Listener) activity; adapter = new ItemsAdapter(activity); }
@Override public void onAttach(Activity host) { super.onAttach(host); router=MediaRouter.getInstance(host); provider=new DemoRouteProvider(getActivity()); router.addProvider(provider); }