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
  • 151,199
  • 17
  • 111
  • 216
kike
  • 3,837
  • 4
  • 22
  • 40

0 Answers0