HOME / ¹®¼°øÀ¯ / ¸®Æ÷Æ®/³í¹® / ±âŸ¸®Æ÷Æ®
0
0°ÇÀÇ Èı⺸±â¸ð¹ÙÀÏ ÇÁ·Î±×·¡¹Ö Áß°£°í»ç Ç®ÀÌ¿¡ ´ëÇØ ±â¼úÇÑ Âü°íÀÚ·áÀÔ´Ï´Ù.
test1£javaÄÚµå package com.example.test1; import android.app.activity; import android.os.bundle; import android.view.view; import android.widget.*; public class mainactivity extends activity { textview text1,text2; edittext edit1; radiogroup rgroup1; radiobutton radioarray[] new radiobutton[3]; button btn1; @override
protected void oncreate(bundle savedinstancestate) {
super.oncreate(savedinstancestate); setcontentview(r.layout.activity main);
text1 (textview) findviewbyid(r.id.textview1);
text2 (textview) findviewbyid(r.id.textview2);
edit1 (edittext) findviewbyid(r.id.edittext1);
rgroup1 (radiogroup) findviewbyid(r.id.radiogroup1);
radioarray[0] (radiobutton) findviewbyid(r.id.radio0);
radioarray[1] (radiobutton) findviewbyid(r.id.radio1);
radioarray[2] (radiobutton) findviewbyid(r.id.radio2);
btn1 (button) findviewbyid(r.id.button1);
btn1.setonclicklistener(new view.onclicklistener() {
public void onclick(view arg0) {
switch (rgroup1.getcheckedradiobuttonid()) {
case r.id.radio0:
toast.maketext(getapplicationcontext(),edit1.gettext().tostring()»¡°,toast.length short).show();
break; case r.id.radio1:
toast.maketext(getapplicationcontext(),edit1.gettext().tostring()³ë¶û,toast.length short).show(); break;
case r.id.radio2:
toast.maketext(getapplicationcontext(),edit1.gettext().tostring()ÆĶû,toast.length short).show();
break; default:
toast. maketext(getapplicationcontext(), »ö±òÀ» ¼±ÅÃÇϼ¼¿ä
, toast. length short)
show(); } } }); } }test1-xmlÄÚµå <linearlayout xmlns:android xmlns:tools android:layout widthfill parent android:layout heightfill parent android:orientationvertical > <textview android:/textview1 android:layout widthwrap content android:layout heightwrap content android:text´ç½ÅÀÇ Ç÷¾×ÇüÀº? /> <edittext android:/edittext1 android:layout widthmatch parent android:layout heightwrap content android:ems10 > <requestfocus /> </edittext> <textview android:/textview2 android:layout widthwrap content android:layout heightwrap content android:text´ç½ÅÀÌ ÁÁ¾ÆÇÏ´Â »ö±òÀº? /> <radiogroup android:/radiogroup1 android:layout widthwrap content android:layout heightwrap content > <radiobutton android:/radio0 android:layout widthwrap content android:layout heightwrap content android:checkedtrue android:text»¡° /> <radiobutton android:/radio1 android:layout widthwrap content android:layout heightwrap content android:text³ì»ö /> <radiobutton android:/radio2 android:layout widthwrap content android:layout heightwrap content android:text³ë¶û /> </radiogroup> <button android:/button1 android:layout widthwrap content android:layout heightwrap content android:textÈ®ÀÎ /> </linearlayout> test2-xml ÄÚµå <linearlayout xmlns:android xmlns:tools android:layout widthfill parent android:layout heightfill parent android:orientationvertical android:/baselayout > <textview android:/text1 android:layout widthwrap content android:layout heightwrap content android:texthellow world cactivity /> <edittext android:/edittext1 android:layout widthmatch parent android:layout heightwrap content android:ems10 android:hint104 > <requestfocus /> </edittext> <edittext android:/edittext2 android:layout widthmatch parent android:layout heightwrap content android:ems10 android:hint12/> <button android:/button1 android:layout widthwrap content android:layout heightwrap content android:text´õÇϱâ /> <button android:/button2 android:layout widthwrap content android:layout heightwrap content android:text»©±â /> <button android:/button3 android:layout widthwrap content android:layout heightwrap content android:text°öÇϱâ /> <button android:/button4 android:layout widthwrap content android:layout heightwrap content android:text³ª´©±â /> <textview android:/text2 android:layout widthwrap content android:layout heightwrap content android:text°è»ê°á°ú : android:textcolor#ff 0 android:textsize30dp /> </linearlayout> test2-javaÄÚµå package com.example.test2; import android.app.activity; import android.graphics.color; import android.os.bundle; import android.view.menu; import android.view.menuinflater; import android.view.menuitem; import android.widget.button; import android.widget.edittext; import android.widget.linearlayout; import android.widget.textview; import android.widget.toast; public class mainactivity extends activity { edittext edit1, edit2; textview text,textresult; button btnadd, btnsub, btnmul, btndiv; string num1, num2; double result; @override
protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);
setcontentview(r.layout.activity main);
edit1 (edittext) findviewbyid(r.id.edittext1); (ÀÌÇÏ »ý·«)
¹ÞÀº º°Á¡
0/5
0°³ÀÇ º°Á¡
¹®¼°øÀ¯ ÀڷḦ µî·ÏÇØ ÁÖ¼¼¿ä.
¹®¼°øÀ¯ Æ÷ÀÎÆ®¿Í Çö±ÝÀ» µå¸³´Ï´Ù.
Æ÷ÀÎÆ® : ÀÚ·á 1°Ç´ç ÃÖ´ë 5,000P Áö±Þ
Çö±Ý : ÀÚ·á 1°Ç´ç ÃÖ´ë 2,000¿ø Áö±Þ