0

I'm creating a reusable fragment in my project.

I want to force the calling Fragment to send the reference through a Bundle so I can get it with getArguments().

How to throw an Exception that I don't want to handle, so I'll force the implementation?

This is how I planed to do it:

Bundle bundle = getArguments();
    String callerFragment = bundle.getString(COMMON_COMPONENT_CALLER_TAG);
    if(callerFragment == null){
        throw new UnknownCallerException("Missing caller name");
    }
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
kike
  • 4,255
  • 5
  • 23
  • 41

0 Answers0