List of usage examples for android.content Context toString
public String toString()
From source file:p1.nd.khan.jubair.mohammadd.popularmovies.MainActivityFragment.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 . j a va2s.c om mCallback = (OnMoviePosterSelectedListener) context; } catch (ClassCastException e) { throw new ClassCastException(context.toString() + " Must implement onMoviePosterSelected."); } }
From source file:com.heske.alexandria.activities.AddBookFragment.java
@Override public void onAttach(Context context) { super.onAttach(context); mActivity = getActivity();//ww w .j av a2 s .com // The hosting Activity must implement // Callback interface. try { mCallback = (AddBookCallback) context; } catch (ClassCastException e) { throw new ClassCastException(context.toString() + getResources().getString(R.string.errorMissingCallbackMethod) + " AddBookCallback"); } }
From source file:org.gateshipone.odyssey.fragments.SavedPlaylistsFragment.java
/** * Called when the fragment is first attached to its context. *//*w w w .j av 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 { mPlaylistSelectedCallback = (OnPlaylistSelectedListener) context; } catch (ClassCastException e) { throw new ClassCastException(context.toString() + " must implement OnPlaylistSelectedListener"); } }
From source file:org.xbmc.kore.ui.sections.video.TVShowProgressFragment.java
@Override public void onAttach(Context context) { super.onAttach(context); try {// w w w.j a v a 2 s . com listenerActivity = (TVShowProgressActionListener) context; } catch (ClassCastException e) { throw new ClassCastException(context.toString() + " must implement TVShowProgressActionListener"); } }
From source file:com.jins_meme.bridge.SpotifyMenuFragment.java
@Override public void onAttach(Context context) { Log.d("DEBUG", "SPOTIFY:: onAttach"); super.onAttach(context); if (context instanceof HueMenuFragment.OnFragmentInteractionListener) { mListener = (OnFragmentInteractionListener) context; } else {//from w w w . j a v a2 s. co m throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener"); } }
From source file:com.xperia64.timidityae.FileBrowserFragment.java
@Override public void onAttach(Context activity) { super.onAttach(activity); try {//from w ww . j a v a 2 s . c om mCallback = (ActionFileBackListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement ActionFileBackListener"); } if (Globals.shouldRestore) { 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), 10); getActivity().sendBroadcast(new_intent); } }
From source file:ro.expectations.expenses.ui.categories.EditCategoryFragment.java
@Override public void onAttach(Context context) { super.onAttach(context); try {//from www . j a va 2 s. c om mListener = (Listener) context; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(context.toString() + " must implement EditCategoryFragment.Listener"); } }
From source file:me.trashout.fragment.EventTrashSelectorFragment.java
@Override public void onAttach(Context context) { super.onAttach(context); try {// w w w . j a va 2s .c o m mCallback = (EventCreateFragment.OnSelectTrashIdsOnMapListener) context; } catch (ClassCastException e) { throw new ClassCastException(context.toString() + " must implement OnHeadlineSelectedListener"); } }
From source file:com.jins_meme.bridge.HueMenuFragment.java
@Override public void onAttach(Context context) { Log.d("DEBUG", "HUE:: onAttach"); super.onAttach(context); if (context instanceof OnFragmentInteractionListener) { mListener = (OnFragmentInteractionListener) context; } else {/* ww w . j a va 2 s.c om*/ throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener"); } }
From source file:com.example.angelina.travelapp.places.PlacesFragment.java
@Override public void onAttach(final Context 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 w w. ja va 2 s .c om mCallback = (FragmentListener) activity; } catch (final ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement FragmentListener"); } }