@Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof ChooserListener) { mListener = (ChooserListener) activity; } }
// tell DoodleFragment that dialog is now displayed @Override public void onAttach(Activity activity) { super.onAttach(activity); DoodleFragment fragment = getDoodleFragment(); if (fragment != null) fragment.setDialogOnScreen(true); }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { dp = (datePickable) activity; } catch (ClassCastException e) { } }
// make sure the Activity implemented it public void onAttach(Activity activity) { super.onAttach(getActivity()); try { this.mListener = (OnCompleteListener) activity; } catch (final ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnCompleteListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { listener = (ParameterEditorListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement listener"); } }
/** * This is a callback method executed when this fragment is attached to an activity. This function * ensures that, the hosting activity implements the interface AlertPositiveListener */ public void onAttach(android.app.Activity activity) { super.onAttach(activity); try { alertPositiveListener = (LayersAlertPositiveListener) activity; } catch (ClassCastException e) { // The hosting activity does not implement the interface AlertPositiveListener throw new ClassCastException(activity.toString() + " must implement AlertPositiveListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (UploadDialogListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement NoticeDialogListener"); } }
@Override public void onAttach(final Activity activity) { super.onAttach(activity); if (!(activity instanceof NoteDialogAction)) { throw new IllegalStateException( "The attaching activity has to implement " + NoteDialogAction.class.getCanonicalName()); } actions = (NoteDialogAction) activity; }
public void onAttach(Activity activity) { super.onAttach(activity); try { datePickerFragmentListener = (OnDatePickerFragmentListener) activity; } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " must implement OnDatePickerFragmentListener"); } }
public void onAttach(Context a) { super.onAttach(a); try { // Instantiate the NoticeDialogListener so we can send events to the host mListener = (AddPhoneListener) a; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(a.toString() + " must implement PhoneBookListener"); } }
// override onAttach to ensure that activity calling the fragment has implemented the listener @Override public void onAttach(Activity activity) { super.onAttach(activity); try { this.mListener = (OnCompleteListener) activity; } catch (final ClassCastException e) { throw new ClassCastException( activity.toString() + " must implement CurrencyListDialog.OnCompleteListener"); } }
@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); try { // Instantiate the NoticeDialogListener so we can send events to the host mListener = (NoticeDialogListener) activity; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement NoticeDialogListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); // verify that activity has implemented listener try { mListener = (NoMovesDialogListener) activity; } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " does not implement NoMovesDialogListener"); } }
// Al enlazar el fragmento con la actividad. @Override public void onAttach(Activity activity) { super.onAttach(activity); // Establece la actividad como listener de los eventos del diálogo. try { mListener = (SiNoDialogListener) activity; } catch (ClassCastException e) { // La actividad no implementa la interfaz, se lanza excepción. throw new ClassCastException(activity.toString() + " debe implementar SiNoDialogListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); if (!(activity instanceof ExitListener)) { throw new RuntimeException( "A activity precisa implementar a interface ExitDialog.ExitListener"); } listener = (ExitListener) activity; }
// Override the Fragment.onAttach() method to instantiate the AddNewMemberListener @Override public void onAttach(Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try { // Instantiate the AddNewMemberListener so we can send events to the host mListener = (AddNewMemberListener) activity; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement AddNewMemberListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); // Make sure our listener is present try { this.listener = (OnConfirmExplicitSuggestionListener) activity; } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " must implement OnConfirmExplicitSuggestionListener"); } }
// Override the Fragment.onAttach() method to instantiate the DialogCB @Override public void onAttach(Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try { ctx = getActivity(); // Instantiate the DialogCB so we can send events to the host } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement DialogCB"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try { // Instantiate the NoticeDialogListener so we can send events to the host mListener = (BuyTicketDialogListener) getTargetFragment(); } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement BuyTicketDialogListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); HSFILENAME = activity.getFilesDir() + "/highscores_file.txt"; // Verify that the host activity implements the callback interface try { // Instantiate the NoticeDialogListener so we can send events to the host mListener = (NoticeDialogListener) activity; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement NoticeDialogListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); if (mUSBMonitor == null) try { mUSBMonitor = ((MainActivity) activity).getUSBController(); } catch (ClassCastException e) { } catch (NullPointerException e) { } if (mUSBMonitor == null) { throw new ClassCastException(activity.toString() + " must implement #getUSBController"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); // This makes sure that the container activity has implemented // the callback interface. If not, it throws an exception try { mCallback = (OnTimeSelectedListener) activity; } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " must implement OnHeadlineSelectedListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { FragmentManager fm = activity.getFragmentManager(); mListener = (ExchangeErrorDialogListener) fm.findFragmentByTag("DASHBOARD_FRAGMENT"); } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + "must implement ExchangeErrorDialogListener Interface"); } catch (NullPointerException e) { throw new NullPointerException(activity.toString() + "DashboardFragment is not initialized"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { // Instantiate the NoticeDialogListener so we can send events to the host listener = (ShippingMethodDialogListener) getTargetFragment(); } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException( getTargetFragment().toString() + " must implement ShippingMethodDialogListener"); } }
@Override public void onAttach(Activity activity) { /* We didn't use a callback like: OnPointListener mListener because we couldn't save the listener with Bundle.setXxx to restore the dialog after, for example, a screen rotation. Due to it, the attached activity must implement the interface. */ super.onAttach(activity); if (!(activity instanceof OnDateSetListener)) { throw new ClassCastException( activity.toString() + " must implement IntegerDialog.OnDateSetListener"); } }
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { listener = (openTimeTableListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString()); } datasource = new DSRecent(getActivity()); try { datasource.open(); if (datasource.getSize() > 0) recent = true; } catch (SQLException e) { e.printStackTrace(); } catch (SQLiteException e) { e.printStackTrace(); } }
@Override public void onAttach(Activity activity) { // TODO Auto-generated method stub super.onAttach(activity); comunicator = (Comunicator) activity; }
@Override public void onAttach(Activity activity) { super.onAttach(activity); this.activity = activity; }
@Override public void onAttach(Activity activity) { super.onAttach(activity); }