본문 바로가기
개발

안드로이드 All WebView methods must be called on the same thread 오류 수정

by 테크냥이 2020. 7. 19.
반응형

All WebView methods must be called on the same thread 오류 시 해결방법입니다.

JavascriptInterface 안에서 동작하는 작업을 post()로 처리하면 되는데요

mWebView.post(new Runnable(){
	@Override
    public void run(){
    	mWebView.loadUrl("UrlString");
    }
});

저는 JavascriptInterface에서 다른 페이지로 이동시키려고 할 때 오류가 발생했고 위와같이 해결했습니다.

 

 

 

 

반응형

댓글