WebviewActivity.java
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class WebviewActivity extends Activity {

private WebView mWebView;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview);

mWebView = (WebView)findViewById(R.id.mWebView);

mWebView.getSettings().setJavaScriptEnabled(true);

mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.setInitialScale(100);
mWebView.loadUrl("http://www.yespia.net/");

mWebView.setWebViewClient(new WebViewClientClass());

}



activity_webview.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">

<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mWebView" />


</LinearLayout>


Posted by yespia.net piacom

댓글을 달아 주세요