/** Parse attributes during inflation from a view hierarchy into the arguments we handle. */
    @Override
    public void onInflate(SupportActivity activity, AttributeSet attrs, Bundle savedInstanceState) {
      super.onInflate(activity, attrs, savedInstanceState);

      TypedArray a = activity.obtainStyledAttributes(attrs, R.styleable.FragmentArguments);
      mLabel = a.getText(R.styleable.FragmentArguments_android_label);
      a.recycle();
    }
 @Override
 public void onAttach(SupportActivity activity) {
   super.onAttach(activity);
   try {
     mListener = (OnButtonSelectedListener) activity;
   } catch (ClassCastException e) {
     throw new ClassCastException(
         activity.toString() + " must implement OnButtonSelectedListener");
   }
 }
Esempio n. 3
0
 @Override
 public void onAttach(SupportActivity activity) {
   super.onAttach(activity);
   // Check that the container activity has implemented the callback
   // interface
   try {
     mListener = (OnTaskListItemClickedListener) activity;
   } catch (ClassCastException e) {
     throw new ClassCastException(
         activity.toString() + " must implement OnTaskListItemClickedListener"); // $NON-NLS-1$
   }
 }