Created
September 22, 2014 14:08
-
-
Save burntcookie90/27a1c58d5d08e188e5fd to your computer and use it in GitHub Desktop.
BaseFragment class that handles registration with the event bus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseFragment extends Fragment { | |
public BaseFragment() {} | |
@Override public void onResume() { | |
super.onResume(); | |
BusProvider.getInstance().register(this); | |
} | |
@Override public void onPause() { | |
super.onPause(); | |
BusProvider.getInstance().unregister(this); | |
} | |
protected void refresh(){ } | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
TextView textView = new TextView(getActivity()); | |
textView.setText(R.string.hello_blank_fragment); | |
return textView; | |
} | |
protected void showToast(String message){ | |
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment