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.xperia64.timidityae.PlaylistFragment.java

@Override
public void onAttach(Context activity) {
    super.onAttach(activity);
    try {//from ww w  .  j  av  a2 s  .  c  o m
        mCallback = (ActionPlaylistBackListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement ActionPlaylistBackListener");
    }
    if (Globals.shouldRestore && (Globals.plist == null || Globals.plist.size() == 0)) {
        Intent new_intent = new Intent();
        new_intent.setAction(getActivity().getResources().getString(R.string.msrv_rec));
        new_intent.putExtra(getActivity().getResources().getString(R.string.msrv_cmd), 12);
        getActivity().sendBroadcast(new_intent);
    }
}

From source file:com.home.young.filepicker.AbstractFilePickerFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {// ww  w . j a v a 2s. com
        mListener = (OnFilePickedListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnFilePickedListener");
    }
}

From source file:org.xbmc.kore.ui.sections.video.TVShowDetailsFragment.java

@Override
public void onAttach(Context activity) {
    super.onAttach(activity);
    try {/*from   w  ww  . jav a 2 s  .  co m*/
        listenerActivity = (TVShowDetailsActionListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement TVShowDetailsActionListener");
    }
}

From source file:org.connectbot.HostEditorFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {//from  ww w.  j a v  a  2s .  c o  m
        mListener = (Listener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement Listener");
    }

    // Now that the fragment is attached to an Activity, fetch the arrays from the attached
    // Activity's resources.
    mColorNames = getResources().obtainTypedArray(R.array.list_colors);
    mColorValues = getResources().obtainTypedArray(R.array.list_color_values);
    mDelKeyNames = getResources().obtainTypedArray(R.array.list_delkey);
    mDelKeyValues = getResources().obtainTypedArray(R.array.list_delkey_values);
}

From source file:ca.frozen.curlingtv.activities.VideoFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {/*from   ww w.  java  2 s . c o  m*/
        Activity activity = (Activity) context;
        fadeListener = (OnFadeListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement OnFadeListener");
    }
}

From source file:com.vest.album.fragment.CameraVideoFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {//from   ww  w  . j  a va2 s  .  co m
        callback = (onResultCallback) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement onResultCallback");
    }
}

From source file:com.synox.android.ui.fragment.OCFileListFragment.java

/**
 * {@inheritDoc}/*www . j  a  v a2s .c om*/
 */
@Override
public void onAttach(Context context) {
    super.onAttach(context);

    Log_OC.e(TAG, "onAttach");
    getActivity().invalidateOptionsMenu();

    try {
        mContainerActivity = (FileFragment.ContainerActivity) context;
        // Todo REMOVE
        //Navigation.setContainerActivity(mContainerActivity);

    } catch (ClassCastException e) {
        throw new ClassCastException(
                context.toString() + " must implement " + FileFragment.ContainerActivity.class.getSimpleName());
    }
    try {
        setOnRefreshListener((OnEnforceableRefreshListener) context);

    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement "
                + SwipeRefreshLayout.OnRefreshListener.class.getSimpleName());
    }
}

From source file:com.joeyturczak.jtscanner.ui.ScannerFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnScanCompletedListener) {
        mScanCompletedListener = (OnScanCompletedListener) context;
    } else {/*from ww w  . j  a  va  2  s. c o  m*/
        throw new RuntimeException(context.toString() + " must implement OnScanCompleteListener");
    }
    if (context instanceof OnScanEditedListener) {
        mScanEditedListener = (OnScanEditedListener) context;
    } else {
        throw new RuntimeException(context.toString() + " must implement OnScanEditedListener");
    }
    if (context instanceof OnScanDeletedListener) {
        mScanDeletedListener = (OnScanDeletedListener) context;
    } else {
        throw new RuntimeException(context.toString() + " must implement OnScanDeletedListener");
    }
}

From source file:dev.datvt.cloudtracks.sound_cloud.LocalTracksFragment.java

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnListFragmentInteractionListener) {
        mListener = (OnListFragmentInteractionListener) context;
        onSelected = (onPlayListSelected) context;
    } else {//  www .j a  v a 2  s.c o m
        throw new RuntimeException(context.toString() + " must implement OnListFragmentInteractionListener");
    }
}

From source file:com.raspi.chatapp.ui.chatting.SendImageFragment.java

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