List of usage examples for android.app Activity toString
@Override
public String toString()
From source file:com.nearnotes.NoteEdit.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); try {/*from w w w.j a v a 2 s . c o m*/ mCallback = (noteEditListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement noteEditListener"); } }
From source file:org.rm3l.ddwrt.mgmt.AbstractRouterMgmtDialogFragment.java
@Override public void onAttach(@NotNull Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try {/*from www . java2s. co m*/ // Instantiate the NoticeDialogListener so we can send events to the host mListener = (RouterMgmtDialogListener) activity; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement NoticeDialogListener"); } }
From source file:com.avapira.bobroreader.BoardFragment.java
/** * @deprecated Use {@link #onAttach(Context)} instead. *///from w w w . j a v a2s. co m @Deprecated public void onAttach(Activity activity) { Log.d(TAG, "attach"); super.onAttach(activity); try { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); recentListSize = Integer.parseInt(prefs.getString("pref_board_recent_list_size", "3")); supervisor = (Castor) activity; } catch (ClassCastException e) { e.printStackTrace(); throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } }
From source file:com.cerema.cloud2.ui.fragment.OCFileListFragment.java
/** * {@inheritDoc}//from w w w. ja v a2 s . c o m */ @Override public void onAttach(Activity activity) { super.onAttach(activity); Log_OC.e(TAG, "onAttach"); try { mContainerActivity = (FileFragment.ContainerActivity) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement " + FileFragment.ContainerActivity.class.getSimpleName()); } try { setOnRefreshListener((OnEnforceableRefreshListener) activity); } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement " + SwipeRefreshLayout.OnRefreshListener.class.getSimpleName()); } }
From source file:com.sbhstimetable.sbhs_timetable_android.CountdownFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); IntentFilter i = new IntentFilter(TimetableActivity.BELLTIMES_AVAILABLE); i.addAction(TimetableActivity.TODAY_AVAILABLE); i.addAction(ApiAccessor.ACTION_BELLTIMES_JSON); i.addAction(ApiAccessor.ACTION_TODAY_JSON); i.addAction(ApiAccessor.ACTION_TODAY_FAILED); if (this.listener == null) { this.listener = new BroadcastListener(); }//from w ww.java 2 s . c om LocalBroadcastManager.getInstance(this.getActivity()).registerReceiver(this.listener, i); ApiAccessor.getBelltimes(activity, true); ApiAccessor.getToday(activity, true); try { mListener = (CommonFragmentInterface) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } }
From source file:bluetoothchat.BluetoothChatFragment.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 {//w w w. ja va 2 s .co m notifyActivityStickerStatusChange = (StepsFragment.OnStickerChange) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnHeadlineSelectedListener"); } }
From source file:com.amazon.android.uamp.ui.PlaybackOverlayFragment.java
/** * {@inheritDoc}//from ww w . ja v a 2 s . c o m */ @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 = (OnPlayPauseClickedListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnPlayPauseClickedListener: " + e); } mContext = getActivity(); }
From source file:com.bq.robotic.robopad_plusplus.fragments.ScheduleRobotMovementsFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); // Check the listener is the correct one: the fragment activity container // implements that listener if (activity instanceof ScheduleRobotMovementsListener) { this.listener = (ScheduleRobotMovementsListener) activity; } else {//from w w w . j a va 2s . com throw new ClassCastException(activity.toString() + " must implement SelectBotListener"); } }
From source file:com.owncloud.android.ui.dialog.LoginWebViewDialog.java
@Override public void onAttach(Activity activity) { Log_OC.v(TAG, "onAttach"); super.onAttach(activity); try {/*from w w w . ja va 2 s. c o m*/ AuthenticationMethod authenticationMethod = AuthenticationMethod .fromValue(getArguments().getInt(ARG_AUTHENTICATION_METHOD)); if (authenticationMethod == null) { throw new IllegalStateException("Null authentication method got to onAttach"); } Handler handler = new Handler(); if (SAML_WEB_SSO == authenticationMethod) { mSsoWebViewClientListener = (SsoWebViewClientListener) activity; mWebViewClient = new SAMLWebViewClient(activity, handler, mSsoWebViewClientListener); } else { throw new IllegalStateException("Invalid authentication method got to onAttach"); } } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " must implement " + SsoWebViewClientListener.class.getSimpleName()); } }
From source file:com.androzic.Preferences.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 w ww. ja v a 2s. co m fragmentHolderCallback = (FragmentHolder) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement FragmentHolder"); } }