Skip to content

enqueueDispatchVisible方法里的queueIdle回调不走 #45

Description

@xupengku123

我看了一下原作者的代码

private void enqueueDispatchVisible() {
        taskDispatchSupportVisible = new Runnable() {
            @Override
            public void run() {
                taskDispatchSupportVisible = null;
                dispatchSupportVisible(true);
            }
        };
        getHandler().post(taskDispatchSupportVisible);
    }

这里是直接post了一条任务
你的这个方法是这样的

private void enqueueDispatchVisible() {

       mIdleDispatchSupportVisible = new MessageQueue.IdleHandler() {
           @Override
           public boolean queueIdle() {
               dispatchSupportVisible(true);
               mIdleDispatchSupportVisible = null;
               return false;
           }
       };
    Looper.myQueue().addIdleHandler(mIdleDispatchSupportVisible);

}

是用空闲任务去调用dispatchSupportVisible,但是有时候不走回调导致我的fragment生命周期的onSupportVisible不执行,请问我要怎么处理

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions