Back to project page ihatecolor_and.
The source code is released under:
Copyright (c) 2013, Sewon Ann All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * ...
If you think the Android project ihatecolor_and listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package kr.pe.kingori.ihatecolor.ui.fragment; /*from w w w. j av a 2 s. c o m*/ import android.app.Activity; import android.support.v4.app.Fragment; import de.greenrobot.event.EventBus; import kr.pe.kingori.ihatecolor.ui.activity.MainActivity; import kr.pe.kingori.ihatecolor.ui.event.GameEvent; import kr.pe.kingori.ihatecolor.ui.event.PlayEvent; public abstract class BaseFragment extends Fragment { protected MainActivity getBaseActivity() { return (MainActivity) getActivity(); } public void onEventMainThread(PlayEvent e) { } public void onEventMainThread(GameEvent e) { } @Override public void onAttach(Activity activity) { EventBus.getDefault().register(this); super.onAttach(activity); } @Override public void onDetach() { EventBus.getDefault().unregister(this); super.onDetach(); } }