コード例 #1
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   if (activity instanceof ChooserListener) {
     mListener = (ChooserListener) activity;
   }
 }
コード例 #2
0
  // 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);
  }
コード例 #3
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   try {
     dp = (datePickable) activity;
   } catch (ClassCastException e) {
   }
 }
コード例 #4
0
 // 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");
   }
 }
コード例 #5
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   try {
     listener = (ParameterEditorListener) activity;
   } catch (ClassCastException e) {
     throw new ClassCastException(activity.toString() + " must implement listener");
   }
 }
コード例 #6
0
 /**
  * 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");
   }
 }
コード例 #7
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   try {
     mListener = (UploadDialogListener) activity;
   } catch (ClassCastException e) {
     throw new ClassCastException(activity.toString() + " must implement NoticeDialogListener");
   }
 }
コード例 #8
0
 @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;
 }
コード例 #9
0
  public void onAttach(Activity activity) {
    super.onAttach(activity);

    try {
      datePickerFragmentListener = (OnDatePickerFragmentListener) activity;
    } catch (ClassCastException e) {
      throw new ClassCastException(
          activity.toString() + " must implement OnDatePickerFragmentListener");
    }
  }
コード例 #10
0
 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");
   }
 }
コード例 #11
0
 // 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");
   }
 }
コード例 #12
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   try {
     mListener = (OnFragmentInteractionListener) activity;
   } catch (ClassCastException e) {
     throw new ClassCastException(
         activity.toString() + " must implement OnFragmentInteractionListener");
   }
 }
コード例 #13
0
 @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");
   }
 }
コード例 #14
0
 @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");
   }
 }
コード例 #15
0
 // 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");
   }
 }
コード例 #16
0
  @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;
  }
コード例 #17
0
 // 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");
    }
  }
コード例 #19
0
 // 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");
   }
 }
コード例 #20
0
 @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");
   }
 }
コード例 #21
0
 @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");
   }
 }
コード例 #22
0
 @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");
   }
 }
コード例 #23
0
  @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");
    }
  }
コード例 #24
0
 @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");
   }
 }
コード例 #25
0
  @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");
    }
  }
コード例 #26
0
 @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");
   }
 }
コード例 #27
0
 @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();
   }
 }
コード例 #28
0
 @Override
 public void onAttach(Activity activity) {
   // TODO Auto-generated method stub
   super.onAttach(activity);
   comunicator = (Comunicator) activity;
 }
コード例 #29
0
ファイル: SyncPrefs.java プロジェクト: zongxingy/NotePad
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   this.activity = activity;
 }
コード例 #30
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
 }