package com.example.jake;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.ViewFlipper;
public class Main extends Activity {
private WebView webview;
Button start, stop;
ViewFlipper flipper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setBuiltInZoomControls(true);
webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webview.getSettings().setLightTouchEnabled(true);
webview.getSettings().setSavePassword(true);
webview.getSettings().setSaveFormData(true);
webview.setWebViewClient(new MyWebViewClient());
webview.loadUrl("http://i-detox.blog.me");
}
private class MyWebViewClient extends WebViewClient {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
}
<LinearLayout 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:orientation="vertical" >
<webView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
'IT 연구회' 카테고리의 다른 글
xml (1) | 2014.03.01 |
---|---|
Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace. (1) | 2013.12.23 |
이중 스크롤뷰(ScrollView)의 scroll 컨트롤하기 (0) | 2013.09.17 |
용량이 1MB가 넘는 파일을 asset에 담을 때 (0) | 2013.09.17 |
인텐트 (Intent) (0) | 2013.09.17 |
안드로이드 스레드 (handler) 핸들러 (0) | 2013.09.17 |
안드로이드 스레드2 핸들러(handler) (0) | 2013.09.17 |
listview (0) | 2013.09.17 |
listview 2 (0) | 2013.09.17 |
listview3 (0) | 2013.09.17 |