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.juick.android.ThreadFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/*from  w  ww. j  av a  2 s .  com*/
        parentActivity = (ThreadFragmentListener) activity;
        navMenu = (MyImageView) activity.findViewById(R.id.navmenu);
        if (navMenu != null) {
            navMenu.setVisibility(View.GONE);
            initNavMenuTranslationX = navMenu.initialTranslationX;
            FlyingItem top = new FlyingItem(activity.getWindow().getDecorView(), R.id.navbar_top);
            FlyingItem bottom = new FlyingItem(activity.getWindow().getDecorView(), R.id.navbar_bottom);
            flyingItems = new FlyingItem[] { top, bottom };
        }
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement ThreadFragmentListener");
    }
}

From source file:com.androzic.MapFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    Log.e(TAG, "onAttach()");

    dimView = new RelativeLayout(getActivity());

    // 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
        waypointActionsCallback = (OnWaypointActionListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnWaypointActionListener");
    }
    try {
        routeActionsCallback = (OnRouteActionListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnRouteActionListener");
    }
}

From source file:com.dsdar.thosearoundme.util.ContactsListFragment.java

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

    try {//from w w  w. j av a  2  s. c  om
        // Assign callback listener which the holding activity must
        // implement. This is used
        // so that when a contact item is interacted with (selected by the
        // user) the holding
        // activity will be notified and can take further action such as
        // populating the contact
        // detail pane (if in multi-pane layout) or starting a new activity
        // with the contact
        // details (single pane layout).
        mOnContactSelectedListener = (OnContactsInteractionListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnContactsInteractionListener");
    }
}

From source file:com.df.dfcarchecker.CarCheck.CarCheckBasicInfoFragment.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  ww . j a va  2s .  c  om
        mCallback = (OnHeadlineSelectedListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnHeadlineSelectedListener");
    }
}

From source file:com.nbplus.vbroadlauncher.fragment.LauncherFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {//from  w w  w.ja v  a 2  s  .  c  o  m
        Log.d(TAG, "LauncherFragment onAttach()");
        ((HomeLauncherActivity) getActivity()).registerActivityInteractionListener(this);

        // check network status
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
        getActivity().registerReceiver(mBroadcastReceiver, intentFilter);

        intentFilter = new IntentFilter();
        intentFilter.addAction(Constants.ACTION_SET_VILLAGE_NAME);
        intentFilter.addAction(IoTConstants.ACTION_IOT_DATA_SYNC_COMPLETED);
        intentFilter.addAction(IoTConstants.ACTION_IOT_SERVICE_STATUS_CHANGED);
        intentFilter.addAction(PushConstants.ACTION_PUSH_STATUS_CHANGED);
        intentFilter.addAction(PushConstants.ACTION_PUSH_MESSAGE_RECEIVED);
        LocalBroadcastManager.getInstance(getActivity()).registerReceiver(mBroadcastReceiver, intentFilter);

        mHandler = new LauncherFragmentHandler(this);
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener");
    }
}

From source file:com.irccloud.android.fragment.MessageViewFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/*  ww  w .  j  a v a2s. c o  m*/
        mListener = (MessageViewListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement MessageViewListener");
    }
}

From source file:edu.usf.cutr.opentripplanner.android.fragments.MainFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/*from www  . j av a  2 s . com*/
        ((MyActivity) activity).setDateCompleteCallback(this);
        setFragmentListener((OtpFragment) activity);
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OtpFragment");
    }
}

From source file:com.kaichaohulian.baocms.ecdemo.ui.chatting.ChattingFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {/*from   w  w w. j  a  va  2  s. c  om*/
        mAttachListener = (OnChattingAttachListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString() + " must implement OnChattingAttachListener");
    }
}