I want to make sure a sheet is closed using
connectSheet.dismiss();. This throws an exception (java.lang.IllegalStateException: Fragment InputSheet{30375ec} (b24c50ad-42e2-4095-95d7-ff6fc0af69df) not associated with a fragment manager.) when the sheet has not called the show method.
How do i check if it is visible before dismissing and make sure no exception is thrown?
Just use the normal method isVisible form the DialogFragment to check if it is visible or not. Or handle the state with a global property for the sheet which has a value when displayed or null when dismissed.
I want to make sure a sheet is closed using
connectSheet.dismiss();
. This throws an exception (java.lang.IllegalStateException: Fragment InputSheet{30375ec} (b24c50ad-42e2-4095-95d7-ff6fc0af69df) not associated with a fragment manager.
) when the sheet has not called theshow
method. How do i check if it is visible before dismissing and make sure no exception is thrown?