Java Code Examples for android.app.Activity#toString()
The following examples show how to use
android.app.Activity#toString() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: android_coursera_1 File: FriendsFragment.java License: MIT License | 6 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); // Make sure that the hosting Activity has implemented // the SelectionListener callback interface. We need this // because when an item in this ListFragment is selected, // the hosting Activity's onItemSelected() method will be called. try { mCallback = (SelectionListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement SelectionListener"); } }
Example 2
Source Project: Androzic File: WaypointList.java License: GNU General Public License v3.0 | 6 votes |
@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 { waypointActionsCallback = (OnWaypointActionListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnWaypointActionListener"); } }
Example 3
Source Project: Gazetti_Newspaper_Reader File: DialogNewContent.java License: MIT License | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { activityCallback = (NewContentCallback) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement NewContentCallback"); } }
Example 4
Source Project: MediaPlayer-Extended File: VideoURIInputDialogFragment.java License: Apache License 2.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnVideoURISelectedListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnVideoURISelectedListener"); } }
Example 5
Source Project: android-tv-leanback File: VideoItemFragment.java License: Apache License 2.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnFragmentInteractionListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } Log.d(VideoItemFragment.class.getName(), "onAttach Called"); }
Example 6
Source Project: SecondScreen File: MultipleVersionsDialogFragment.java License: Apache License 2.0 | 5 votes |
@SuppressWarnings("deprecation") @Override public void onAttach(Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try { // Instantiate the Listener so we can send events to the host listener = (Listener) activity; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement Listener"); } }
Example 7
Source Project: Smartlab File: BookDetailsFragment.java License: Apache License 2.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnBookDetailsFragmentListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } }
Example 8
Source Project: MediaChooser File: ImageFragment.java License: Apache License 2.0 | 5 votes |
@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 { mCallback = (OnImageSelectedListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnImageSelectedListener"); } }
Example 9
Source Project: zulip-android File: MessageListFragment.java License: Apache License 2.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (Listener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement Listener"); } }
Example 10
Source Project: AndroidGradientUI File: ContactsFragment.java License: Apache License 2.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnFragmentInteractionListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } }
Example 11
Source Project: Cirrus_depricated File: SearchShareesFragment.java License: GNU General Public License v2.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (ShareFragmentListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } }
Example 12
Source Project: openvidonn File: CurrentFragment.java License: GNU General Public License v3.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnCurrentFragmentInteractionListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } }
Example 13
Source Project: android-storage File: RenameDialog.java License: Apache License 2.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (DialogListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement DialogListener"); } }
Example 14
Source Project: SecondScreen File: ProfileEditFragment.java License: Apache License 2.0 | 5 votes |
@SuppressWarnings("deprecation") @Override public void onAttach(Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try { // Instantiate the Listener so we can send events to the host listener = (Listener) activity; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement Listener"); } }
Example 15
Source Project: faveo-helpdesk-android-app File: MyTickets.java License: Open Software License 3.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnFragmentInteractionListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } }
Example 16
Source Project: android-discourse File: ConfirmDialogFragment.java License: Apache License 2.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); Fragment f = getParentFragment(); if (activity instanceof ConfirmListener) { mListener = (ConfirmListener) activity; } else if (f instanceof ConfirmListener) { mListener = (ConfirmListener) f; } else { throw new ClassCastException(activity.toString() + " must implement ConfirmListener"); } }
Example 17
Source Project: mytracks File: ChooseAccountDialogFragment.java License: Apache License 2.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { caller = (ChooseAccountCaller) activity; } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " must implement " + ChooseAccountCaller.class.getSimpleName()); } }
Example 18
Source Project: openvidonn File: AlarmsFragment.java License: GNU General Public License v3.0 | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnFragmentInteractionListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } }
Example 19
Source Project: MediaChooser File: VideoFragment.java License: Apache License 2.0 | 5 votes |
@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 { mCallback = (OnVideoSelectedListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnVideoSelectedListener"); } }
Example 20
Source Project: open_flood File: SeedDialogFragment.java License: MIT License | 5 votes |
@Override public void onAttach(Activity activity) { super.onAttach(activity); try { listener = (SeedDialogFragment.SeedDialogFragmentListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement SeedDialogFragmentListener"); } }