I have a project on the way but I can't seem to add javascript support to this method, any insight? I didn't include the line in the code because I tried it in every way possible, and even when it wouldn't error it would still not load Js support.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
rootView.setTag(getArguments().getInt(ID)); //define the rootView with an id Tab in order to be accessed later from inside the menu button
swipeRefreshWeb = rootView.findViewById(R.id.swipeRefreshWeb);
swipeRefreshWeb.setOnRefreshListener(this);
//GET THE WEBVIEW FROM THE XML LAYOUT
webView = rootView.findViewById(R.id.section_web_view);
webView.setWebViewClient(new WebViewClient() { //NEEDED TO CREATE IN ORDER TO OPEN SOME WEBPAGES INSIDE THE APP AND NOT BY OPENING THE CHROME APP
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(getContext(), description, Toast.LENGTH_SHORT).show();
}
});
webView.loadUrl(getArguments().getString(URL)); //load the url
rootView.findViewById(R.id.btnWebBack).setOnClickListener(new View.OnClickListener() { //Define the Back click button
@Override
public void onClick(View view) {
webView.goBack(); //go back when the back button is clicked
}
});
return rootView;
}