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:de.geeksfactory.opacclient.frontend.StarredFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/*from ww  w.  j ava 2 s. c om*/
        callback = (Callback) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement SearchFragment.Callback");
    }
}

From source file:com.google.cloud.solutions.cloudadventure.GameScoresFragment.java

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

    // Set the callback activity to use
    try {/*from w  w w .ja  v a 2 s  . com*/
        callback = (OnGameScoresClickListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnGameScoresClickListener");
    }
}

From source file:fr.steren.climbtracker.GradePickerFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    // Verify that the host activity implements the callback interface
    try {//w  ww.  j ava 2s  .  c  om
        // Instantiate the NoticeDialogListener so we can send events to the host
        mListener = (GradeDialogListener) 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.ariesmcrae.mymemories.ui.story.StoryListFragment.java

/**
 * @see android.support.v4.app.Fragment#onAttach(android.app.Activity)
 *//*from  w  w  w  . j  av a  2  s.  c o m*/
@Override
public void onAttach(Activity activity) {
    Log.d(LOG_TAG, "onAttach start");
    super.onAttach(activity);
    try {
        mOpener = (OnOpenWindowInterface) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(
                activity.toString() + " must implement OnOpenWindowListener" + e.getMessage());
    }
    Log.d(LOG_TAG, "onAttach end");
}

From source file:fr.mixit.android.ui.fragments.BoundServiceDialogFragment.java

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

    try {//from w w  w .  j  a  va2s .  com
        @SuppressWarnings("unused")
        final BoundServiceContract contract = (BoundServiceContract) activity;
    } catch (final ClassCastException e) {
        throw new ClassCastException(
                activity.toString() + " must implement " + BoundServiceContract.class.getName());
    }
}

From source file:com.nikhilnayak.games.octoshootar.ui.fragments.ProfileFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    if (activity instanceof ProfileFragment.Listener) {
        mListener = (ProfileFragment.Listener) activity;
        mPlayerProfile = new PlayerProfile(
                activity.getSharedPreferences(PlayerProfile.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE));
    } else {/*from  w  w w  .  j  a va 2  s  .  c om*/
        throw new ClassCastException(activity.toString() + " must implement ProfileFragment.Listener");
    }
}

From source file:org.chinamil.downland.fragments.HeadlinesFragment.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   ww w. j  a  va2 s.  com
        mCallback = (OnHeadlineSelectedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnHeadlineSelectedListener");
    }
}

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

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    // Verify that activity implements the callback interface
    try {//from w  ww . java2 s  .  c  o  m
        // Instantiate the NoticeDialogListener so we can send events to the host
        mListener = (ExpansionDownloadDialogListener) activity;
    } catch (ClassCastException e) {
        // The activity doesn't implement the interface, throw exception
        throw new ClassCastException(activity.toString() + " must implement ExpansionDownloaderDialogFragment");
    }
}

From source file:com.kklop.ghostmode.HighScoreDialog.java

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

From source file:com.androzic.route.RouteEdit.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  ww.j  a  v  a 2  s  .c  o m
        waypointActionsCallback = (OnWaypointActionListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnWaypointActionListener");
    }
}