Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fragment/TwoFragment
- package info.androidboss.retrofit.fragment;
- import android.content.Context;
- import android.os.Bundle;
- import android.support.v4.app.Fragment;
- import android.view.LayoutInflater;
- import android.view.View;
- import android.view.ViewGroup;
- import info.androidboss.retrofit.R;
- public class TwoFragment extends Fragment {
- private OnFragmentInteractionListener listener;
- public static TwoFragment newInstance() {
- return new TwoFragment();
- }
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- return inflater.inflate(R.layout.fragment_two, container, false);
- }
- @Override
- public void onAttach(Context context) {
- super.onAttach(context);
- if (context instanceof OnFragmentInteractionListener) {
- listener = (OnFragmentInteractionListener) context;
- } else {
- throw new RuntimeException(context.toString()
- + " must implement OnFragmentInteractionListener");
- }
- }
- @Override
- public void onDetach() {
- super.onDetach();
- listener = null;
- }
- public interface OnFragmentInteractionListener {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement