在trigger.io中删除backPressed事件侦听器

时间:2013-12-18 16:24:05

标签: android events back-button trigger.io

以某种方式可以删除由trigger.io中的forge.event.backPressed.addListener添加的android后退按钮事件侦听器吗?据我所知,没有API方法。那么没有它可以做到这一点还是现在不行?

1 个答案:

答案 0 :(得分:0)

你试过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
        }

    }