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.microsoft.identity.client.testapp.CacheFragment.java

@Override
public void onAttach(final Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener) {
        mListener = (OnFragmentInteractionListener) context;
    } else {// w w w  . j  a va 2s  . c om
        throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener");
    }
}

From source file:com.creationgroundmedia.popularmovies.MovieListActivity.java

private void updateProviderFromInternet(Context context) {
    Log.d(LOG_TAG, "updateProviderFromInternet (" + context.toString() + ")");
    MovieSyncAdapter.syncImmediately(context);
}

From source file:com.urbantamil.projmadurai.MaduraiBookCoverFragment.java

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

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

From source file:org.gateshipone.odyssey.dialogs.ChooseStorageVolumeDialog.java

@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 {/*w w  w  . j ava 2  s. c om*/
        mDirectorySelectedCallback = (OnDirectorySelectedListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnDirectorySelectedListener");
    }
}

From source file:com.example.arrayjumper.FragmentBasics.HeadlinesFragment.java

@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 {//from w ww .  jav a  2s .  c om
        mCallback = (OnHeadlineSelectedListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnHeadlineSelectedListener");
    }
}

From source file:com.belatrixsf.allstars.ui.contacts.ContactFragment.java

private void castOrThrowException(Context context) {
    try {//from  w ww . ja va 2s  . c  o  m
        contactFragmentListener = (ContactFragmentListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement ContactFragmentListener");
    }
}

From source file:cz.maresmar.sfm.view.menu.CursorPagerFragment.java

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

From source file:ro.expectations.expenses.ui.accounts.AccountsFragment.java

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

    try {/*from  ww  w  . j av a  2s.  c  o m*/
        mOnAppBarHeightChangeListener = (OnAppBarHeightChangeListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnAppBarHeightChangeListener");
    }
}

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

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

    try {//from w w  w.j av a  2 s .c o  m
        connectionListener = (ConnectionFragment.ConnectionListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement ConnectionListener");
    }
}

From source file:io.github.tjg1.nori.fragment.ImageFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {/*w w w.j  av  a  2 s.c om*/
        listener = (ImageFragmentListener) getContext();
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnFragmentInteractionListener");
    }
}