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:com.bq.robotic.robopad.fragments.RobotFragment.java

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

    // Check the listener is the correct one: the fragment activity container
    // implements that listener
    if (activity instanceof RobotListener) {
        this.listener = (RobotListener) activity;
    } else {//from  w  ww  .ja  v  a2 s  .  c  om
        throw new ClassCastException(activity.toString() + " must implement robotListener");
    }
}

From source file:org.mozilla.gecko.home.HomeFragment.java

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

    try {//w  w w .  j a  v  a2  s .co  m
        mUrlOpenListener = (OnUrlOpenListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement HomePager.OnUrlOpenListener");
    }

    try {
        mUrlOpenInBackgroundListener = (OnUrlOpenInBackgroundListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(
                activity.toString() + " must implement HomePager.OnUrlOpenInBackgroundListener");
    }
}

From source file:com.nearnotes.ChecklistDialog.java

/**
 * onAttach is called to check that the MainActivity is implementing the callback
 * /*from   w  w  w  .ja v  a2s.c  o m*/
 * @param activity
 *            the activity that should have the callback implemented
 * @throws ClassCastException
 *             if the activity does not implement CheckDialogListener
 */
@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 = (CheckDialogListener) activity;
    } catch (ClassCastException e) {
        // The activity doesn't implement the interface, throw exception
        throw new ClassCastException(activity.toString() + " must implement CheckDialogListener");
    }
}

From source file:com.androzic.track.TrackDetails.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 {// w w  w .ja va2s .c  o m
        fragmentHolderCallback = (FragmentHolder) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement FragmentHolder");
    }
    try {
        trackActionsCallback = (OnTrackActionListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnTrackActionListener");
    }
}

From source file:com.paulina.sadowska.robotwirelesscontroller.Bluetooth.BluetoothFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {//from   www .  j  a  va  2 s .com
        mCallback = (BluetoothActivityCallback) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnHeadlineSelectedListener");
    }
}

From source file:edu.vuum.mocca.ui.story.CreateStoryFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {//from ww w.  j  a  v a 2s  .c o  m
        mOpener = (OnOpenWindowInterface) activity;
        resolver = new MoocResolver(activity);
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnOpenWindowListener");
    }
}

From source file:com.chenenyu.areapicker.AreaPicker.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    this.mActivity = (FragmentActivity) activity;
    try {// ww  w. ja  va  2 s.co m
        mCallback = (OnAreaPickListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnAreaPickListener");
    }
}

From source file:com.syncedsynapse.kore2.ui.AlbumListFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/*from  w  w w  .  ja v a2s .c o  m*/
        listenerActivity = (OnAlbumSelectedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnAlbumSelectedListener");
    }
}

From source file:org.developfreedom.logmein.ui.DialogAlert.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    // Verify that the host activity implements the callback interface
    try {/*from   w w w .  j a  v  a 2 s  .com*/
        // Instantiate the NoticeDialogListener so we can send events to the host
        returnDialogMessage = (ReturnDialogMessage) activity;
    } catch (ClassCastException e) {
        // The activity doesn't implement the interface, throw exception
        throw new ClassCastException(activity.toString() + " must implement ReturnDialogListener");
    }
}

From source file:com.achow101.bitcointalkforum.fragments.HomeFragment.java

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

    try {/*  w w w .j a va  2  s. c o m*/
        mBoardCallback = (GoToBoard) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement GoToBoard");
    }

}