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.mbientlab.metawear.app.ModuleFragmentBase.java

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

    if (!(activity instanceof FragmentBus)) {
        throw new ClassCastException(String.format(Locale.US, "%s %s", activity.toString(),
                activity.getString(R.string.error_fragment_bus)));
    }//from   www  . j a  v  a 2 s .c  om

    fragBus = (FragmentBus) activity;
    activity.getApplicationContext().bindService(new Intent(activity, MetaWearBleService.class), this,
            Context.BIND_AUTO_CREATE);
}

From source file:answer.example.answer.view.FileListFragment.java

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

    try {// w w w  .ja  v a 2  s.  c o  m
        mListener = (Callbacks) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement FileListFragment.Callbacks");
    }
}

From source file:edu.lapinamk.holli.rawcatcare.SlidingDayTabsFragment.java

@Override
public void onAttach(Activity activity) {

    super.onAttach(activity);
    try {/* w  ww. j  ava2 s.c om*/
        mDayListener = (OnDaySelectedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnDaySelectedListener");
    }
}

From source file:ca.ualberta.slevinsk.gameshow.NumberPickerFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/* www  . ja  v  a  2  s . c o m*/
        onPlayerCountChangeListener = (NumberPicker.OnValueChangeListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnValueChangListener");
    }
}

From source file:com.androidinahurry.tunisiabanking.ui.BalanceFragment.java

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

    try {// w  w  w .ja  va  2 s  .  c o m
        this.mListener = (LoadingViewListener) activity;
    } catch (final ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement LoadingViewListener");
    }
}

From source file:com.google.android.apps.mytracks.fragments.ConfirmDialogFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {//from  w w  w.j  ava2  s .  c om
        caller = (ConfirmCaller) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(
                activity.toString() + " must implement " + ConfirmCaller.class.getSimpleName());
    }
}

From source file:com.stoutner.privacybrowser.CreateHomeScreenShortcut.java

public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/*from w w  w .  j av a  2s . c  o  m*/
        buttonListener = (CreateHomeScreenSchortcutListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement CreateHomeScreenShortcutListener.");
    }
}

From source file:am.roadpolice.roadpolice.dialogs.DialogConfirmation.java

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

    try {/*from  www.  j  av  a 2 s. co  m*/
        this.mListener = (IDialogConfirmationListener) activity;
    } catch (final ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement IDialogConfirmationListener");
    }
}

From source file:com.codinguser.android.contactpicker.ContactDetailsFragment.java

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

    try {/*from  ww w .  j  a  v a 2s.com*/
        mContactsListener = (OnContactSelectedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnContactSelectedListener");
    }
}

From source file:com.lightstreamer.demo.android.StocksFragment.java

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

    try {/*  w w w .  j  a v  a 2s  . com*/
        lsClient = (LightstreamerClientProxy) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement LightstreamerClientProxy");
    }
    lsClient.addSubscription(mainSubscription);

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception.
    try {
        listener = (onStockSelectedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnHeadlineSelectedListener");
    }
}