Example usage for android.app Activity toString

List of usage examples for android.app Activity toString

Introduction

In this page you can find the example usage for android.app Activity toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:com.notepadlite.NoteListFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    // Verify that the host activity implements the callback interface
    try {/*w  w w. j  av a  2s  . c  o m*/
        // 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");
    }
}

From source file:com.anjalimacwan.fragment.NoteListFragment.java

@SuppressWarnings("deprecation")
@Override/*from   www. j a va  2s.  c o  m*/
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");
    }
}

From source file:cn.tycoon.lighttrans.fileManager.AbstractFilePickerFragment.java

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

From source file:com.mchp.android.PIC32_BTSK.ColorFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    // This checks that the container activity (PIC32_BTSK) has implemented
    // the OnSendRequestListener interface. If not, it throws an exception. If it
    // has been implemented, sets mSendRequestCallback to the implementation in the
    // container activity.
    try {//from ww  w  .j a v  a 2 s .  c  om
        mSendRequestCallback = (OnSendRequestListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnSendRequestListener");
    }

    // This checks that the container activity (PIC32_BTSK) has implemented
    // the OnLastColorSendRequestListener interface. If not, it throws an exception. If it
    // has been implemented, sets mLastColorSendRequestCallback to the implementation in the
    // container activity.
    try {
        mLastColorSendRequestCallback = (OnLastColorSendRequestListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnLastColorSendRequestListener");
    }

    // This checks that the container activity (PIC32_BTSK) has implemented
    // the OnCancelLastColorRequestListener interface. If not, it throws an exception. If it
    // has been implemented, sets mCancelLastColorRequestCallback to the implementation in the
    // container activity.
    try {
        mCancelLastColorRequestCallback = (OnCancelLastColorRequestListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnCancelLastColorRequestListener");
    }
    return;
}

From source file:com.sbhstimetable.sbhs_timetable_android.BelltimesFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    IntentFilter i = new IntentFilter();
    i.addAction(ApiAccessor.ACTION_NOTICES_JSON);
    i.addAction(ApiAccessor.ACTION_BELLTIMES_JSON);
    i.addAction(ApiAccessor.ACTION_TODAY_JSON);
    i.addAction(ApiAccessor.ACTION_BELLTIMES_FAILED);
    Log.i("belltimesFragment", "I want " + i.getAction(3));

    if (this.listener == null) {
        this.listener = new BroadcastListener(this);
    }/*from  w w  w  . jav a 2  s  .  c om*/
    LocalBroadcastManager.getInstance(this.getActivity()).registerReceiver(this.listener, i);
    try {
        mListener = (CommonFragmentInterface) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement CommonFragmentInterface");
    }
}

From source file:com.sandklef.coachapp.fragments.TopFragment.java

@Override
public void onAttach(Activity activity) {
    //    Log.d(LOG_TAG, "  ---> onAttach()");
    super.onAttach(activity);
    //Log.d(LOG_TAG, "  --- onAttach()");
    try {/* w  w  w . j  a  va  2 s .  c  om*/
        //      Log.d(LOG_TAG, "  --- onAttach() 1");
        mListener = (OnFragmentInteractionListener) activity;
        //    Log.d(LOG_TAG, "  --- onAttach() 2");
    } catch (ClassCastException e) {
        //  Log.d(LOG_TAG, "  --- onAttach() exception: " + e);

        throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener");
    }
    //Log.d(LOG_TAG, "  <--- onAttach()");

}

From source file:com.owncloud.android.ui.fragment.PublicShareDialogFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {//from  ww w . jav a  2 s .c  o  m
        mListener = (ShareFragmentListener) activity;
    } catch (IllegalStateException e) {
        throw new IllegalStateException(
                activity.toString() + " must implement OnShareFragmentInteractionListener");
    }
}

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

@Override
public void onAttach(Activity context) {
    super.onAttach(context);
    try {//from  ww  w  .j ava 2 s.  c o m
        callback = (onResultCallback) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement onResultCallback");
    }
}

From source file:net.niyonkuru.koodroid.ui.PageFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    mContext = activity.getApplicationContext();

    mSettings = App.getSettings();/*from   w  w  w  .j av a2 s .  c om*/

    Locale locale = new Locale(getString(R.string.locale), "CA");

    mNumberFormat = DecimalFormat.getInstance(locale);
    mCurrencyFormat = CurrencyUtils.getCurrencyFormat(locale);

    try {
        mCallBack = (BaseCallBack) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement BaseCallBack type");
    }
}

From source file:com.shinymayhem.radiopresets.FragmentStations.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/*from  www.  ja  v  a2  s.  c o m*/
        // Instantiate the ListenerAddDialog so we can send events to the host
        mListener = (PresetListener) activity;
    } catch (ClassCastException e) {
        // The activity doesn't implement the interface, throw exception
        throw new ClassCastException(activity.toString() + " must implement PresetListener");
    }
}