[Android Studio] niknak75:
Hi there,

So first thing you need to do is grant INTERNET permission to your app by edditing AndroidManifest.xml

For example (I've made all my additions in bold),

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.application.my.webviewtest" >

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

[B]<uses-permission android:name="android.permission.INTERNET" />[/B]
</manifest>

Then you need to edit your View so that you have a WebView widget and some buttons, i'm just showing a back and forward button here, so in my activity_main.xml I have,

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

[B] <LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">

<WebView
android:layout_width="match_parent"
android:layout_height="400dp"
android:id="@+id/myWebView"/>

<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="64dp">

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="<"
android:id="@+id/backButton"
android:onClick="OnBackButtonClick"/>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=">"
android:id="@+id/forwardButton"
android:onClick="OnForwardButtonClick"/>
</LinearLayout>
</LinearLayout>[/B]
</RelativeLayout>

You'll notice I've put it in a vertical linearlayout, and then inside of that a horizontal linearlayout to host the buttons, now for the code in MainActivity.java,

package com.application.my.webviewtest;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
[B]import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;[/B]

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

[B] WebView webview = (WebView) this.findViewById(R.id.myWebView);
webview.setWebViewClient(new WebViewClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://www.google.co.uk");[/B]
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}

[B] public void OnBackButtonClick(View view) {
WebView webview = (WebView) this.findViewById(R.id.myWebView);
webview.goBack();
}

public void OnForwardButtonClick(View view) {
WebView webview = (WebView) this.findViewById(R.id.myWebView);
webview.goForward();
}[/B]

}

I've zipped up the app folder of my AndroidStudio project for you

http://npsoftware.s3.amazonaws.com/android/app.zip

[IMG="Screenshot"]http://npsoftware.s3.amazonaws.com/android/webviewtestscreenshot.PNG[/IMG]