티스토리 뷰

WebView 를 커스터마이징 하는 포인트

  1. WebChromeClient subclass 생성하고 세팅하기

    This class is called when something that might impact a browser UI happens, for instance, progress updates and JavaScript alerts are sent here (see Debugging Tasks).


  2. WebViewClient subclass 생성하고 세팅하기

    It will be called when things happen that impact the rendering of the content, eg, errors or form submissions. You can also intercept URL loading here (via shouldOverrideUrlLoading()).


  3. WebSettings 수정하기

    such as enabling JavaScript with setJavaScriptEnabled().


  4. addJavascriptInterface(Object, String) method로 JavaScript-to-Java interfaces 추가하기

    This lets you bind Java objects into the WebView so they can be controlled from the web pages JavaScript.


댓글