Example usage for android.app Activity toString

List of usage examples for android.app Activity toString

Introduction

In this page you can find the example usage for android.app Activity toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:edu.usf.cutr.opentripplanner.android.fragments.DirectionListFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/*from w w w . j  a  v a2  s .com*/
        setFragmentListener((OtpFragment) activity);
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OtpFragment");
    }
}

From source file:com.digitalarx.android.ui.preview.PreviewImageFragment.java

/**
 * {@inheritDoc}/*  ww w  .  jav  a 2s.com*/
 */
@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    if (!(activity instanceof OnTouchListener)) {
        throw new ClassCastException(
                activity.toString() + " must implement " + OnTouchListener.class.getSimpleName());
    }
}

From source file:com.androzic.route.RouteList.java

@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 {//from  w  w w. j  a  va2 s .  c o  m
        routeActionsCallback = (OnRouteActionListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnRouteActionListener");
    }
}

From source file:com.nononsenseapps.filepicker.ui.core.AbstractFilePickerFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {//  w  w w.ja v a2 s .  c  o m
        listener = (OnFilePickedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnFilePickedListener");
    }
}

From source file:io.indy.drone.fragment.StrikeDetailFragment.java

@Override
public void onAttach(Activity activity) {
    ifd("onAttach");
    super.onAttach(activity);
    try {//from  w  w w  . j a  v  a  2s . c  om
        mOnStrikeInfoListener = (OnStrikeInfoListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnStrikeInfoListener");
    }
}

From source file:nl.jalava.appostle.AppListFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    if (activity instanceof OnItemSelectedListener) {
        listener = (OnItemSelectedListener) activity;
    } else {//from ww  w .ja  v  a2 s  .co m
        throw new ClassCastException(
                activity.toString() + " must implement AppListFragment.OnItemSelectedListener");
    }
}

From source file:com.RSMSA.policeApp.Dialogues.PaymentConfirmationDialogue.java

public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {//  w w  w. j  a v  a2s .c  o m
        this.mListener = (OnCompleteListener) activity;
    } catch (final ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnCompleteListener");
    }
}

From source file:info.wncwaterfalls.app.ResultsMapFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    // Make sure the containing activity implements the search listener interface
    try {//from ww  w  .  j ava  2 s .c om
        sQueryListener = (OnWaterfallQueryListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnWaterfallQueryListener");
    }

    // And the select listener interface
    try {
        sSelectListener = (OnWaterfallSelectListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnWaterfallSelectListener");
    }

    // And the interfaces for obtaining locations from a LocationClient
    try {
        sLocationQueryListener = (OnLocationQueryListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnQueryLocationListener");
    }
}

From source file:cl.smartcities.isci.transportinspector.dialogs.BusSelectionDialog.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    // Verify that the host activity implements the callback interface
    try {//from   www . ja v  a2 s .c om
        // Instantiate the NoticeDialogListener so we can send events to the host
        listener = (BusSelectionAdapter.ListViewAdapterListener) activity;
    } catch (ClassCastException e) {
        // The activity doesn't implement the interface, throw exception
        throw new ClassCastException(activity.toString() + " must implement NoticeDialogListener");
    }
}

From source file:com.example.android.honeypad.ui.NoteListFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {// ww w  .j  a v a2s .  c o m
        // check that the containing activity implements our callback
        mContainerCallback = (NoteEventsCallback) activity;
    } catch (ClassCastException e) {
        activity.finish();
        throw new ClassCastException(activity.toString() + " must implement NoteSelectedCallback");
    }
}