Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AboutFragment extends Fragment {
- @Inject
- protected Bus mBus;
- /**
- * The fragment argument representing the section number
- * for this fragment.
- */
- public static final String ARG_SECTION_NUMBER = "section_number";
- public static AboutFragment newInstance(int sectionNumber) {
- AboutFragment fragment = new AboutFragment();
- Bundle args = new Bundle();
- args.putInt(ARG_SECTION_NUMBER, sectionNumber);
- fragment.setArguments(args)
- return fragment;
- }
- public AboutFragment() {
- // Required empty public constructor
- }
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- return inflater.inflate(R.layout.fragment_about, container, false);
- }
- @Override
- public void onAttach(Activity activity) {
- super.onAttach(activity);
- int sectionNumber = getArguments().getInt(ARG_SECTION_NUMBER);
- if (mBus == null) {
- Log.e(getClass().getName(), "OTTO has not arrived here");
- } else {
- mBus.post(new AboutFragmentAttachedEvent(sectionNumber));
- }
- // onSectionAttachedCallback(activity);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement