As the title asks, is a WeakReference really necessary?
The reason I ask, is that there is nothing in this API that seems to handle the case where the Activity goes in to the background.
As in, I would expect this:
@Override
protected void onPause()
{
super.onPause();
Permiso.getInstance().setActivity(null);
}
But setActivity is @nonnull, so this won't compile.
Will WeakReference handle the case where the Activity goes in to the background?
If not, then why not add a "Permiso.onPause" method and require the user to call it?
(Internally the code would "Activity activity = mActivity;" and test activity for null and respond appropriately)