I have this code and it works fine to open a web page :
package com.example.fragmenttabs;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.app.Fragment;
public class FragmentTab2 extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragmenttab2, container, false);
String url = "http://example.com";
WebView view = (WebView)rootView.findViewById(R.id.webView2);
view.getSettings().setJavaScriptEnabled(true);
view.loadUrl(url);
return rootView;
}
}
but unfortunately, when I clicked on a link inside that webview, it will open Google Chrome. How to disable this behaviour? I want to make it open in same webview. not open in Google Chrome. thank you.