How to close a conference room in android?

i have a global variable:
JitsiMeetActivity session;

when i want to join the room i call:
session = new JitsiMeetActivity();

    session.launch(this, options);

which works fine.
but how can i close it programmatically?
if i try to call:
try
{
session.leave();
}
catch (Exception e)
{
Log.e(“session”, "Failed to properly leave " + e);
}
i get:
session: Failed to properly leave java.lang.NullPointerException: Attempt to invoke virtual method ‘org.jitsi.meet.sdk.JitsiMeetView org.jitsi.meet.sdk.JitsiMeetFragment.getJitsiView()’ on a null object reference
even though session is not null.

the same happens if i call:
session.onDestroy()
or session.finish();

though session.onBackPressed() works fine…

what am i missing?
thanks