Fragment 返回监听

under Android  tag     Published on June 29th , 2021 at 02:49 pm

requireActivity().getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), new OnBackPressedCallback(true) {
    @Override
    public void handleOnBackPressed() {
        // ... ...
    }
});

本文由 surface 创作,采用 知识共享署名4.0 国际许可协议进行许可,转载前请务必署名
  文章最后更新时间为:September 29th , 2021 at 04:36 pm
分享到:Twitter  Weibo  Facebook