Remove backPressed event listeners in trigger.io

174 Views Asked by At

Is it somehow possible to remove android back button event listeners added by forge.event.backPressed.addListener in trigger.io? As far as I know, there are no API methods for that. So is it possible to do it without that or is that a no go for now?

1

There are 1 best solutions below

1
Hamad On

Did you try onBackPressed() ?

  @Override
    public void onBackPressed() {
        //super.onBackPressed();
        if(SOME_CONDITION_TO_CHECK){
            //THIS BLOCK WILL NOT DO ANYTHING AND WOULD DISABLE BACK BUTTON

        }else{
            super.onBackPressed();
        //THIS BLOCK WILL BE CALLED IF ABOVE COND IS FALSE, AND WOULD ENABLE BACK BUTTON
        }

    }