美文网首页
Only the original thread that cr

Only the original thread that cr

作者: 令狐达耶 | 来源:发表于2019-05-29 11:24 被阅读0次

    Only the original thread that created a view hierarchy can touch its views.

    最近在积累自己的Android UI compenent库,在做到自定义相机的时候,点击拍摄按钮,当前的activity会自动finish(),并报以上错误,出错位置在我改变界面组件的visibility属性

    rl_resultview.setVisibility(View.VISIBLE);
    

    然后,我做了如下调整,让这部分界面更新在UI主线程中进行

    CameraCustomize.this.runOnUiThread(new Runnable() {
        @Override
        public void run() {
            rl_resultview.setVisibility(View.VISIBLE);
        }
    });
    

    来源:https://blog.csdn.net/qq_28978893/article/details/80882308

    相关文章

      网友评论

          本文标题:Only the original thread that cr

          本文链接:https://www.haomeiwen.com/subject/jwmetctx.html