Redirect links with an anchor in WebViewClient?

Has anyone faced a problem with a redirect in the internal webView is initialized with WebViewClient?

Trouble is that he is not caught by a link like: http://www.ru/index.html#label2. That is not the anchor catches at all.

Here is the section of code:

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R. layout.activity_main);
 webview = (WebView) findViewById(R. id.webView1);
 webview.setWebViewClient(new WebViewClient() {
@Override
 public boolean shouldOverrideUrlLoading(WebView view, String url) {
 Log.i("", "shouldOverrideUrlLoading url=" + url);
 // TODO Auto-generated method stub
 return super.shouldOverrideUrlLoading(view, url);
}

@Override
 public void onPageFinished(WebView view, String url) {
 Log.i("", "onPageFinished url=" + url);
 // TODO Auto-generated method stub
 super.onPageFinished(view, url);
}
});
webview.getSettings().setLoadWithOverviewMode(false);
webview.getSettings().setUseWideViewPort(false);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webview.getSettings().setUserAgentString("android.RTkabinet");
 String url = "https://paycard.rt.ru/payallrbs_rtk.jsp?sourceSystem=1002&payMethod=YandexMoney&item=98000607231;1;RT.SOUTH.23.CONTRACT_ID";
webview.loadUrl(url);
 }



On Stackoverflow there are examples of work with local files file:///file.html but, it is done through the crutches and they will ship directly via loadUrl. I need to make a redirect. In fact, shouldOverrideUrlLoading() does not indicate even that came a link with the anchor and I'd never figure that out.

Artificially coincidentally known end links, I tried to load the link with an anchor http://link#0but it didn't work.

How can you beat Android?
October 3rd 19 at 05:59

Find more questions by tags Android