List of usage examples for android.app Activity toString
@Override
public String toString()
From source file:org.erlymon.litvak.monitor.view.fragment.ConfirmDialogFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try {//from w w w . j a v a 2 s .c om // Instantiate the NoticeDialogListener so we can send events to the host mListener = (ConfirmDialogListener) activity; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement ConfirmDialogFragment"); } }
From source file:com.nikhilnayak.games.octoshootar.ui.fragments.GameModeDetailsFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof GameModeDetailsFragment.Listener) { mListener = (GameModeDetailsFragment.Listener) activity; mPlayerProfile = new PlayerProfile( activity.getSharedPreferences(PlayerProfile.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE)); } else {/*from w ww. j a va 2 s .c o m*/ throw new ClassCastException(activity.toString() + " must implemenet GameModeDetailsFragment.Listener"); } }
From source file:com.example.dididoit.app.NewItemDialogFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); // make sure that the activity implements the listener interface try {//from w ww . j a v a2s.c o m // Instantiate the listener so that we can send events to the host mListener = (NewItemDialogListener) activity; } catch (ClassCastException e) { // The activity doesn't implement the listener interface, so throw exception throw new ClassCastException(activity.toString() + " must implement " + "NewItemDialogListener"); } }
From source file:com.syncedsynapse.kore2.ui.hosts.AddHostFragmentZeroconf.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); try {//from www.j ava2s .c o m listener = (AddHostZeroconfListener) activity; } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " must implement AddHostZeroconfListener interface."); } }
From source file:com.deliciousdroid.fragment.BrowseBookmarkFeedFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); try {/* w ww.j a v a2s.c om*/ bookmarkSelectedListener = (OnBookmarkSelectedListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnBookmarkSelectedListener"); } }
From source file:com.nikhilnayak.games.octoshootar.ui.fragments.BonusFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof BonusFragment.Listener) { mListener = (BonusFragment.Listener) activity; mPlayerProfile = new PlayerProfile( activity.getSharedPreferences(PlayerProfile.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE)); } else {/*ww w . ja va 2 s .c o m*/ throw new ClassCastException(activity.toString() + " must implement BonusFragment.Listener"); } }
From source file:com.nearnotes.NoteList.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); // This makes sure that the container activity has implemented the callback interface. If not, it throws an exception try {//from ww w .j av a 2s. c o m mCallback = (OnNoteSelectedListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnHeadlineSelectedListener"); } }
From source file:com.example.tahsi.challenge.FreeCombDialog.java
@Override public void onAttach(Activity 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 .ja v a 2 s. c om*/ mCallback = (ButtonSelect) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnHeadlineSelectedListener"); } }
From source file:com.ti.omap.android.multidispapp.photo.SlideshowCtrl.java
public SlideshowCtrl(SlideshowListener listener, Activity activity) { // This makes sure that the container activity has implemented // the callback interface. If not, it throws an exception try {/*from w w w . j a va 2 s . c om*/ mCommandCallback = (OnCommandListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnHeadlineSelectedListener"); } mListener = listener; mContext = activity; }
From source file:org.openhab.habdroid.ui.BindingThingTypesFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); Log.d(TAG, "onAttach()"); try {/*from w w w. j a va 2 s . com*/ mActivity = (OpenHABMainActivity) activity; mAsyncHttpClient = mActivity.getAsyncHttpClient(); mActivity.setTitle(R.string.app_bindings_supportedthings); } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must be OpenHABMainActivity"); } }