@Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof MainActivity) { mActivity = (MainActivity) activity; } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); this.activity = (FourthTaskAndroid) activity; preferencesManager = new PreferencesManager(activity); }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { onItemSelectListener = (OnItemSelectListener) activity; } catch (ClassCastException e) { throw new ClassCastException("Class must implement OnItemSelectListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnWordSelectedListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnWordSelectedListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { galleryListFragmentListener = (GalleryListFragmentListener) activity; } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " must implement OnGalleryFragmentInteractionListener"); } }
@Override public void onAttach(Context context) { super.onAttach(context); try { mListener = (OnFragmentInteractionListener) context; } catch (ClassCastException e) { throw new ClassCastException( context.toString() + " must implement OnFragmentInteractionListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof UpdateView) { mUpdate = (UpdateView) activity; } else { throw new IllegalArgumentException("Activity must implement the UpdateView interface"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); if (!(activity instanceof Callbacks)) { throw new IllegalStateException("Activity must implement fragment's callbacks."); } mCallbacks = (Callbacks) activity; }
@Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof EventListener) { mEventListener = (EventListener) activity; } else { throw new ClassCastException( "Activity must implement " + EventListener.class.getSimpleName()); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); // Activities containing this fragment must implement its callbacks. if (!(activity instanceof MarketCallbacks)) { throw new IllegalStateException("Activity must implement fragment's callbacks."); } mCallbacks = (MarketCallbacks) activity; }
@Override public void onAttach(Activity activity) { super.onAttach(activity); // try { // mListener = (OnFragmentInteractionListener) activity; // } catch (ClassCastException e) { // throw new ClassCastException(activity.toString() // + " must implement OnFragmentInteractionListener"); // } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); // Attempt to cast our hosting activity to a Dispatcher object to delegate to try { dispatcher = (OptionDetailsFragmentDispatcher) activity; } catch (ClassCastException cce) { throw new ClassCastException( activity.toString() + " must implement OptionDetailFragmentDispatcher"); } }
@Override public void onAttach(final Activity activity) { super.onAttach(activity); if (!(activity instanceof ReadItLaterActivity)) { Log.wtf(TAG, String.format("%s expected", ReadItLaterActivity.class.getSimpleName())); return; } this.activity = (ReadItLaterActivity) activity; }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { callback = (OnCourseSelectedListener) activity; } catch (ClassCastException e) { Log.d("carl", "Could not cast class"); throw new ClassCastException( activity.toString() + " upcoming! must implement CourseListFragment.OnCourseSelectedListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof OnFlyListFragmentItemClick) { // L'activity che contiene il fragment è compatibile con l'interfaccia di Callback, mi // memorizzo il riferimento. mActivityAttached = (OnFlyListFragmentItemClick) activity; } else { // L'activity non è compatibile, creo un riferimento fittizzio. mActivityAttached = new OnFlyListFragmentItemClick() { public void onClick(int item) {} }; } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { listeSelectListener = (ListItemSelectListener) activity; } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " doit implementer ListItemSelectListener"); } try { listeMapListener = (ListItemMapListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " doit implementer ListMapListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); mActivity = (DownloadDetailsActivity) activity; }
@Override public void onAttach(Activity activity) { super.onAttach(activity); setHasOptionsMenu(true); }
@Override public void onAttach(Activity activity) { super.onAttach(activity); mImageDownloader = KegbotCore.getInstance(activity).getImageDownloader(); }
@Override public void onAttach(Activity activity) { super.onAttach(activity); mBookmarkListener = (OnBookmarkItemClickListener) activity; }
@Override public void onAttach(Activity activity) { super.onAttach(activity); this.listener = (WorkoutListListener) activity; }
@Override public void onAttach(Context context) { this.context = context; super.onAttach(context); }