Skip to content

Instantly share code, notes, and snippets.

@adib2149
Created October 25, 2016 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adib2149/443d29e081129e99c50c2c2b67a5afd1 to your computer and use it in GitHub Desktop.
Save adib2149/443d29e081129e99c50c2c2b67a5afd1 to your computer and use it in GitHub Desktop.
package nav.bottom;
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;
public class FirstFragment extends Fragment {
private OnFragmentInteractionListener listener;
public static FirstFragment newInstance() {
return new FirstFragment();
}
@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_first, 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 {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment