2016-10-09 1 views
0

기타 문서 says- 정확히 B 웹뷰가 URL을 처리 할 때의 URL 대향 핸들링 호스트 어플리케이션 w/차이가 무엇WebView 클라이언트에서 URL 로딩을 무시하는 것은 무엇입니까?

/** 
    * Give the host application a chance to take over the control when a new 
    * url is about to be loaded in the current WebView. If WebViewClient is not 
    * provided, by default WebView will ask Activity Manager to choose the 
    * proper handler for the url. If WebViewClient is provided, return true 
    * means the host application handles the url, while return false means the 
    * current WebView handles the url. 
    * This method is not called for requests using the POST "method". 
    * 
    * @param view The WebView that is initiating the callback. 
    * @param url The url to be loaded. 
    * @return True if the host application wants to leave the current WebView 
    *   and handle the url itself, otherwise return false. 
    */ 
    public boolean shouldOverrideUrlLoading(WebView view, String url) { 
     return false; 
    } 

?

답변

1

"호스트 응용 프로그램"은 작성중인 것입니다. 따라서 "URL을 처리하는 호스트 응용 프로그램"은 개발자로서 URL을 사용하여 수행 할 작업을 결정할 때입니다.

WebView 구현은 다른 개발자가 작성했습니다. 따라서 "WebView는 URL을 처리합니다."는 개발자가 URL을 어떻게 처리할지 결정할 때입니다.

고전적으로는, WebView는 독립형 웹 브라우저에서 해당 URL을 시작, URL을 감싸는 ACTION_VIEWIntentstartActivity()를 호출하여 URL을 처리 할 것입니다. 앱 개발자는 을 사용하여 WebView (따라서 앱 내부)에 URL을 보관하려면 WebView에서 loadUrl()을 호출 할 수 있습니다.

+0

이유는이 책에서 완벽하게 언급됩니다. 또한 Google의 Android 팀 회원입니까? –

+0

@ ShirgillFarhanAnsari : 아니요. – CommonsWare