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:cz.maresmar.sfm.view.portal.PortalListFragment.java

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

From source file:nl.thehyve.transmartclient.fragments.ServerOverviewFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {/*  w ww.j a v  a  2 s  . c  o m*/
        mListener = (OnFragmentInteractionListener) context;
        restInteractionListener = (RestInteractionListener) context;
        menuListener = (MenuListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnFragmentInteractionListener"
                + ", RestInteractionListener" + " and MenuListener");
    }
}

From source file:org.gluu.oxpush2.app.ProcessFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OxPush2RequestListener) {
        oxPush2RequestListener = (OxPush2RequestListener) context;
    } else {/*w  w w.java2  s  .c o m*/
        throw new RuntimeException(context.toString() + " must implement OxPush2RequestListener");
    }
}

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

/**
 * Called when the fragment is first attached to its context.
 *//*from  www .j a va 2  s.  co  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 {
        mSelectedCallback = (ArtistSelectedCallback) 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.ae.apps.tripmeter.fragments.expenses.TripsListFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof ExpensesInteractionListener) {
        mListener = (ExpensesInteractionListener) context;
        mListener.showAddTripFAB();/* w  w w .ja  va 2  s. c o  m*/
        mListener.registerFABListener(this);
    } else {
        throw new RuntimeException(context.toString() + " must implement OnListFragmentInteractionListener");
    }
}

From source file:com.justplay1.shoppist.features.lists.items.add.AddListItemFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {//from w  w w. j  a v a2s  .  c o m
        listItemListener = (AddListItemListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement FragmentInteractionListener");
    }
}

From source file:org.tigase.messenger.phone.pro.roster.RosterItemFragment.java

@Override
public void onAttach(Context context) {
    this.sharedPref = getContext().getSharedPreferences("RosterPreferences", Context.MODE_PRIVATE);

    super.onAttach(context);

    if (context instanceof OnRosterItemIteractionListener) {
        mListener = (OnRosterItemIteractionListener) context;
    } else {/*  ww w .ja  v a 2  s  .c  om*/
        throw new RuntimeException(context.toString() + " must implement OnRosterItemIteractionListener");
    }

    Intent intent = new Intent(context, XMPPService.class);
    getActivity().bindService(intent, mConnection, 0);
}

From source file:org.gluu.super_gluu.app.fragment.HomeFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OxPush2RequestListener) {
        oxPush2RequestListener = (OxPush2RequestListener) context;
    } else {/*from   w w  w  . ja  v  a2  s  .  c  om*/
        throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener");
    }

    if (context instanceof GluuAdListener) {
        gluuAdListener = (GluuAdListener) context;
    } else {
        throw new RuntimeException(context.toString() + " must implement GluuAdListener");
    }
}

From source file:com.rowland.movies.ui.fragments.MainFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    // Ensure attached activity has implemented the callback interface.
    try {//from  ww  w.  j  a v a  2  s  .  c om
        // Acquire the implemented callback
        mMovieSelectionCallBack = (IMovieSelectionCallBack) context;
    } catch (ClassCastException e) {
        // If not, it throws an exception
        throw new ClassCastException(context.toString() + " must implement IMovieSelectionCallBack");
    }
}

From source file:me.trashout.fragment.EventDetailFragment.java

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

    try {//from   w w w.j  ava  2  s .c  o m
        onEventJoinedListener = (OnEventJoinedListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnEventJoinedListener");
    }
}