Before API 23 I used Fragment\'s onAttach methods to get my listener instance, then the reference is cleaned inside onDetach. ex:
@Override public void onAtt
Well, what is deprecated is onAttach(Activity activity); method, but the whole flow remains. so you may do nothing really as onAttach(Activity activity); is going to be still supported long enough.
onAttach(Activity activity);