Advertisement
rama_astadipati

TwoFragment

Jun 24th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. fragment/TwoFragment
  2.  
  3. package info.androidboss.retrofit.fragment;
  4.  
  5. import android.content.Context;
  6. import android.os.Bundle;
  7. import android.support.v4.app.Fragment;
  8. import android.view.LayoutInflater;
  9. import android.view.View;
  10. import android.view.ViewGroup;
  11.  
  12. import info.androidboss.retrofit.R;
  13.  
  14.  
  15. public class TwoFragment extends Fragment {
  16.  
  17. private OnFragmentInteractionListener listener;
  18.  
  19. public static TwoFragment newInstance() {
  20. return new TwoFragment();
  21. }
  22.  
  23. @Override
  24. public void onCreate(Bundle savedInstanceState) {
  25. super.onCreate(savedInstanceState);
  26. }
  27.  
  28. @Override
  29. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  30. Bundle savedInstanceState) {
  31. return inflater.inflate(R.layout.fragment_two, container, false);
  32. }
  33.  
  34. @Override
  35. public void onAttach(Context context) {
  36. super.onAttach(context);
  37. if (context instanceof OnFragmentInteractionListener) {
  38. listener = (OnFragmentInteractionListener) context;
  39. } else {
  40. throw new RuntimeException(context.toString()
  41. + " must implement OnFragmentInteractionListener");
  42. }
  43. }
  44.  
  45. @Override
  46. public void onDetach() {
  47. super.onDetach();
  48. listener = null;
  49. }
  50.  
  51. public interface OnFragmentInteractionListener {
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement