Вопрос

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