Answer the question
In order to leave comments, you need to log in
Redirect link with anchor in WebViewClient?
Has anyone experienced a redirect issue on an inner webView initialized with a WebViewClient?
The trouble is that it does not catch a link of the form http://www.ru/index.html#label2
. That is, it does not catch the anchor, at all.
Here is a piece 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);
}
http://link#0
, but it didn't work. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question