Reputation: 69
I think that title say all important, I want it to http://studiodamage.sweb.cz/.
My code:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_web, container, false);
WebView webView = (WebView)rootView.findViewById(R.id.webview);
webView.getSettings().setUserAgentString("Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/20 Safari/537.31");
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://studiodamage.sweb.cz/");
return rootView;
}
Upvotes: 2
Views: 2054
Reputation: 11
webView.getSettings().setUserAgentString("1"); //for desktop 1 or mobile 0.
Now this is in 12/2021
Upvotes: 0
Reputation: 3993
Assuming you meant to view website as a desktop site try:
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);
OR
webview.getSettings().setUserAgent(1);//for desktop 1 or mobil 0.
OR
Try something more desktop browser looking such as:
String ua = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/20100101 Firefox/4.0";
Upvotes: 2