Guest User

Untitled

a guest
May 27th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. if (context instanceof MainFragmentListener)
  2.  
  3. @Override
  4. public void onAttach(Context context) {
  5. super.onAttach(context);
  6. if (context instanceof MainFragmentListener) {
  7. mListener = (MainFragment.MainFragmentListener) context;
  8. } else {
  9. throw new RuntimeException(context.toString()
  10. + " must implement OnFragmentInteractionListener");
  11. }
  12. }
Add Comment
Please, Sign In to add comment