Advertisement
Guest User

AboutFragment

a guest
May 21st, 2014
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1. public class AboutFragment extends Fragment {
  2.  
  3.     @Inject
  4.     protected Bus mBus;
  5.  
  6.     /**
  7.      * The fragment argument representing the section number
  8.      * for this fragment.
  9.      */
  10.     public static final String ARG_SECTION_NUMBER = "section_number";
  11.  
  12.     public static AboutFragment newInstance(int sectionNumber) {
  13.         AboutFragment fragment = new AboutFragment();
  14.         Bundle args = new Bundle();
  15.         args.putInt(ARG_SECTION_NUMBER, sectionNumber);
  16.         fragment.setArguments(args)
  17.         return fragment;
  18.     }
  19.  
  20.     public AboutFragment() {
  21.         // Required empty public constructor
  22.     }
  23.  
  24.     @Override
  25.     public View onCreateView(LayoutInflater inflater, ViewGroup container,
  26.                              Bundle savedInstanceState) {
  27.         return inflater.inflate(R.layout.fragment_about, container, false);
  28.     }
  29.  
  30.     @Override
  31.     public void onAttach(Activity activity) {
  32.         super.onAttach(activity);
  33.         int sectionNumber = getArguments().getInt(ARG_SECTION_NUMBER);
  34.         if (mBus == null) {
  35.             Log.e(getClass().getName(), "OTTO has not arrived here");
  36.         } else {
  37.             mBus.post(new AboutFragmentAttachedEvent(sectionNumber));
  38.         }
  39. //        onSectionAttachedCallback(activity);
  40.     }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement