ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î


[Source] WebView¸¦ ÀÌ¿ëÇؼ­, ÀÌÀü À¥ÆäÀÌÁö·Î À̵¿
8³â Àü
WebView¸¦ »ç¿ë½Ã, ¹æ¹®ÇÑ ÀÌÀü ÆäÀÌÁö¹× (ÀÌÀüÆäÀÌÁö¿¡¼­) ´ÙÀ½ÆäÀÌÁö À̵¿½ÃÅ°´Â ¸Þ¼Òµå »ç¿ë¿¹Á¦ ÀÔ´Ï´Ù.


package co.kr.codein;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.Button;
import android.view.View.OnClickListener;

public class WebViewExam extends Activity implements OnClickListener{

    private final int FP = ViewGroup.LayoutParams.FILL_PARENT;
    private final int WC = ViewGroup.LayoutParams.WRAP_CONTENT;

    private Button buttonBack;
    private Button buttonForward;
    private WebView webview;

    @Override protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        LinearLayout linearLayout = new LinearLayout(this);
        linearLayout.setOrientation(LinearLayout.VERTICAL);
        setContentView(linearLayout);


        LinearLayout btnLinearLayout = new LinearLayout(this);
        btnLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
  
        buttonBack = new Button(this);
        buttonBack.setText("Back");
        buttonBack.setOnClickListener(this);

        buttonForward = new Button(this);
        buttonForward.setText("Forward");
        buttonForward.setOnClickListener(this);

        btnLinearLayout.addView(buttonBack, createParam(WC, WC));
        btnLinearLayout.addView(buttonForward, createParam(WC, WC));


        webview = new WebView(this);
        webview.loadUrl("http://cafe.naver.com/aphone.cafe");

        linearLayout.addView(btnLinearLayout, createParam(FP, WC));
        linearLayout.addView(webview, createParam(WC, WC));
    }

    private LinearLayout.LayoutParams createParam(int w, int h){
        return new LinearLayout.LayoutParams(w, h);
    }

    public void onClick(View v) {
  //Back ¹öÆ° Ŭ¸¯½Ã, ÀÌÀüÆäÀÌÁö·Î À̵¿
        if (v == buttonBack){
            if (webview.canGoBack()){
                webview.goBack();
            }
        }
  //Forward ¹öÆ° Ŭ¸¯½Ã, ´ÙÀ½ÆäÀÌÁö·Î À̵¿
  else if (v == buttonForward){
            if (webview.canGoForward()){
                webview.goForward();
            }
        }
    }
}
ÃßõÃßõ : 286 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
1,076
Jscript 5.8 ¿ë º¸¾È ¾÷µ¥ÀÌÆ®(KB971961) ´Ù¿î·Îµå ¸µÅ© ÀÔ´Ï´Ù
1,075
Internet Explorer Ãß°¡ ±â´É ¹®Á¦ ÇØ°á
1,074
Internet Explorer ±âº» ¼³Á¤À» º¹±¸ (°³ÀÎ ¼³Á¤ »èÁ¦ ¿É¼ÇÀ» »ç¿ë)
1,073
½ºÅ¸ÀϽÃÆ®(css)¿¡¼­ A:link, A:visited, A:active, A:hover ¼³¸í
1,072
META TagÀÇ Á¾·ù¿Í »ç¿ë¹æ¹ý
1,071
ȨÆäÀÌÁö ·Îº¿ ¼³Á¤ ¹æ¹ý
1,070
·¹ÀÌ¾î »ó´Ü ¹«Á¶°Ç°íÁ¤
1,069
[jquery] alert¹Ú½º ¸»°í ·¹ÀÌ¾î ¹Ú½º¸¦ ¶ç¿öº¸¼¼¿ä
1,068
À©µµ¿ì ¾ÏÈ£ ºÐ½ÇÇßÀ»¶§ ..
1,067
[Windows] ÀÛ¾÷°ü¸®ÀÚ ½ÇÇà ÆÄÀÏ ÃÑÁ¤¸®
1,066
Áö±Ý À©µµ¿ì 7 â ¸ð¾çÀÌ À©µµ¿ì °íÀüÀ¸·Î ³ª¿Ã¶§..
1,065
°£´ÜÇÑ ¸í·É¾î·Î Á»ºñ PC È®ÀÎÇϱâ
1,064
Internet Explorer ȣȯ¼º ·»´õ¸µ ¸ðµå·Î º¸±â
1,063
div ·¹À̾ƿô Àâ±â!
1,062
Çϵåµð½ºÅ© ÆÄƼ¼Ç ¼û±â±â
1,061
¹ÙÀÌ¿À½º ºÎÆ® ÇÁ·Î¼¼½º
1,060
À©µµ¿ì XPÀÇ ºÎÆà °úÁ¤
1,059
ÇÁ·Î½ÃÀú ½ÃÀÛ ÁöÁ¡ _except_handler4_commonÀ»(¸¦) DLL msvcrt.dll¿¡¼­ ãÀ» ¼ö ¾ø½À´Ï´Ù
1,058
È°¼ºÆÄƼ¼ÇÀ» ºñÈ°¼ºÆÄƼ¼ÇÀ¸·Î º¯°æÇÏ´Â ¹æ¹ý
1,057
windows XP ÀÚµ¿½ÇÇà ²ô±â
1,056
À¯ÇØÇÑ »çÀÌÆ® ±¤°í¸Þ¼¼Áö°¡ ³ª¿ÀÁö ¾Ê°Ô Çϱâ
1,055
Á¦°¡ Âü°í·Î ÇÏ´Â ¹èÄ¡ÆÄÀÏ ÀÛ¼º¹ýµîÀÔ´Ï´Ù
1,054
À©µµ¿ì XP °øÀ¯Æú´õ ¾ÏÈ£°É±â
1,053
¹ÙÅÁÈ­¸éÀ» Dµå¶óÀ̺ê·Î!~!!!!!!
1,052
½Ã½ºÅÛÆÄÀÏ È®ÀåÀÚ!!
1,051
À¥Ç¥ÁØÀ» À§ÇÑ <iframe></iframe>
1,050
[CSS/À¥Ç¥ÁØ] DOCTYPE ¼±¾ð
1,049
CSS Àý´ë À§Ä¡¸¦ »ç¿ëÇÑ ÇÁ·¹ÀÓ È¿°ú
1,048
Recommended Doctype Declarations to use in your Web document
1,047
CSS ·¹À̾ƿô ÅÛÇø´ »çÀÌÆ®
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.