I\'m currently making an android application for a forum, basically it just loads the website in a webview and that works fine and all, but I\'m trying to add an option to v
Create a new string In the activity of the webview, create a new string,
String MyUA = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 " +
"(KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36";
So we created a string for user agent, the user agent defined in the string is of a desktop browser user agent, with this user agent set – your Android browser will load desktop version of websites. You can change this user agent to other user agents you like.
So we set the string, now let’s call it
web.getSettings().setUserAgentString(MyUA)
Here we called the string that we have set, it is ready now.
This code can be inside the oncreate method of the web activity.