Example usage for android.content Context toString

List of usage examples for android.content Context toString

Introduction

In this page you can find the example usage for android.content Context toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.esri.android.ecologicalmarineunitexplorer.summary.SummaryFragment.java

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

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    try {/*ww  w . j a va 2s.co  m*/
        mCallback = (OnRectangleTappedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnRectangleTappedListener");
    }
}

From source file:com.concavenp.nanodegree.popularmoviesimproved.MovieListingFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnMovieSelectionListener) {
        mListener = (OnMovieSelectionListener) context;
    } else {//from  w  w w.  java  2s .  com
        throw new RuntimeException(context.toString() + " must implement OnMovieSelectionListener");
    }
}

From source file:edumsg.edumsg_android_app.EditProfileFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);

    try {//w w  w  .  j  a v  a  2  s  .c  o m
        mCallback = (OnInfoEditedListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnHeadlineSelectedListener");
    }
}

From source file:org.gateshipone.malp.application.fragments.serverfragments.SavedPlaylistsFragment.java

/**
 * Called when the fragment is first attached to its context.
 *//* ww  w.ja  v a  2  s  . c om*/
@Override
public void onAttach(Context context) {
    super.onAttach(context);

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    try {
        mCallback = (PlaylistCallback) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnArtistSelectedListener");
    }

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    try {
        mFABCallback = (FABFragmentCallback) context;
    } catch (ClassCastException e) {
        mFABCallback = null;
    }
}

From source file:com.scooter1556.sms.android.fragment.AudioDirectoryFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);

    try {//from  w ww .j  a v a  2 s . c  o  m
        mediaElementListener = (MediaElementFragment.MediaElementListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement MediaElementListener");
    }
}

From source file:org.gateshipone.odyssey.fragments.GenericAlbumsFragment.java

/**
 * Called when the fragment is first attached to its context.
 *///  w w  w. ja v a 2 s  .  c o  m
@Override
public void onAttach(Context context) {
    super.onAttach(context);

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    try {
        mAlbumSelectedCallback = (OnAlbumSelectedListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnAlbumSelectedListener");
    }

    try {
        mToolbarAndFABCallback = (ToolbarAndFABCallback) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement ToolbarAndFABCallback");
    }
}

From source file:org.gateshipone.malp.application.fragments.ProfilesFragment.java

/**
 * Called when the fragment is first attached to its context.
 *///from   ww  w .  j  av  a2s  .com
@Override
public void onAttach(Context context) {
    super.onAttach(context);

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    try {
        mCallback = (ProfileManageCallbacks) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnArtistSelectedListener");
    }

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    try {
        mFABCallback = (FABFragmentCallback) context;
    } catch (ClassCastException e) {
        mFABCallback = null;
    }
}

From source file:com.billooms.harppedals.keysignature.KeySignatureFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnKeySigChangeListener) {
        keySigChangeListener = (OnKeySigChangeListener) context;
    } else {//from  ww  w. j ava  2s.c o m
        throw new RuntimeException(context.toString() + " must implement OnKeySigChangeListener");
    }
}

From source file:com.billooms.harppedals.chords.ChordFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnChordChangeListener) {
        chordChangeListener = (OnChordChangeListener) context;
    } else {/*from  ww w .  j av a2s.c  o  m*/
        throw new RuntimeException(context.toString() + " must implement OnChordChangeListener");
    }
}

From source file:com.concavenp.artistrymuse.fragments.BaseFragment.java

@Override
public void onAttach(Context context) {

    super.onAttach(context);

    // Re-attach to the parent Activity interface
    if (context instanceof OnInteractionListener) {

        mInteractionListener = (OnInteractionListener) context;

    } else {//from  w  w  w  . j a v a 2  s  .co m

        throw new RuntimeException(context.toString() + " must implement OnInteractionListener");

    }

    // Register as a listener to SharedPreference ArtistryMuseUID changes
    loadSharedPreferences(context);
    mSharedPreferences.registerOnSharedPreferenceChangeListener(this);

}