-
2017.05.09
리스트뷰 (ListView) 사용 예시 3
1. MainActivity.java 123456789101112131415161718192021package ... import android.os.Bundle;import android.support.v7.app.AppCompatActivity;import android.widget.ListView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ListView listView = (ListView) fin..
-
2017.05.09
리스트뷰 (ListView) 사용 예시 2
1. MainActivity.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 package org.androidtown.javaandandroidchap14; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ArrayAdapter; import android.widget.ListView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate..
-
2017.05.09
리스트뷰 (ListView) 사용 예시 1
1. MainActivity.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 package org.androidtown.javaandandroidchap14; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ListView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.lay..
-
2017.05.09
프레임 레이아웃을 이용한 버튼 클릭 시 그림 전환
1. MainActivity.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 package ... import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.ImageView; public class MainActivity extends AppCompatActivity { ..
-
2017.05.07
스택 (Stack) & 큐 (Queue)
1. MainActivity.class 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687package ... import android.os.Bundle;import android.support.v7.app.AppCompatActivity;import android.view.View;import android.widget.Button;import android.widget.EditText; import java.util.Stack;import java.util...
-
2017.05.06
버튼을 누를 때 마다 스크롤뷰에 담겨진 레이아웃에 텍스트뷰 넣는 방법
1. MainActivity.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 package ... import android.graphics.Color; import android.os.Bundle; import android.support.v7.app.AppCompatActiv..
-
2017.05.05
화면이 터치되었을 때, X 좌표 및 Y 좌표를 알아내는 방법
1. MainActivity.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 package ... import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.MotionEvent; import android.view.View; import android.widget.EditText; import android.widget.FrameLayout; public class MainActivity extends AppCompatActivity { Ed..