문제

Acually i wanted to load the content in the webview , which is in a xhtml file .

I want to disable the accessibility to the content . Click on the link/texts must not navigate to that particular page .

More particularly , I have the contents page of a book in the xhtml file and click on the contents must not navigate to the particular page .

WebView.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
       return true;
    }  
});

Will work good but this stops the doulble tap zoom as well . I want to stop accessing the content without affecting the tap zoom .

And one more is that , what does webview.getSettings().setAllowContentAccess(false); refer to in webview .

Thanks in Advance .

도움이 되었습니까?

해결책

If you only want to prevent navigations (user following links) then you need to use the shouldOverrideUrlLoading API:

webview.setWebViewClient(new WebViewClient() {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
       return true;
    }
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top