i try to open target _blank from onCreateWindow of WebChromeClient from this post
Android - Open target _blank links in WebView with external browser
but data returns null.
example site getintopc.com
@Override
public boolean onCreateWindow(WebView view, boolean dialog, boolean userGesture, Message resultMsg)
{
WebView.HitTestResult result = view.getHitTestResult();
String data = result.getExtra();
models.add(models.size() - 1, new WebpageModel(DEFAULT_TITLE,
data));
navDrawerAdapter.notifyDataSetChanged();
fragments.add(WebpageFragment.newInstance(fragments.size(),
models.get(models.size() - 2).getUrl()));
getActivity().getSupportFragmentManager().beginTransaction()
.hide(fragments.get(current_position))
.add(R.id.container, fragments.get(fragments.size() - 1))
.commit();
current_position = fragments.size() - 1;
return false;
}
guys i found this project working.
http://therockncoder.blogspot.com/2014/04/understanding-androids-webchromeclient.html?m=1
it creates new webview with the url of target _blank . but the problem is i can't get the url. I only want the url since i am opening it with the same webview of different fragment tabs.
example i tested getintopc.com