4장. Activity와 Intent
·
안드로이드/연습 코드
1. SampleLayoutInflater 1-1. activity_menu.xml 1-2. sub1.xml 1-3. MenuActivity.java public class MenuActivity extends AppCompatActivity { LinearLayout container; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_menu); container = findViewById(R.id.container); Button button = findViewById(R.id.button); button.setOn..
3장. 위젯
·
안드로이드/연습 코드
1. GradientDrawable, StateListDrawable 1-1. back_drawable.xml 1-2. finger_drawable.xml (여기에서 클릭을 감지) 1-3. activity_main.xml 2. Event (GesterDetetor 사용) 2-1. activity_main.xml 2-2. MainActivity.java package org.techtown.sampleevent; import android.os.Bundle; import android.view.GestureDetector; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android..
2장. 뷰와 레이아웃
·
안드로이드/연습 코드
1. TextView 전송 1-1. activity_main.xml 1-2. MainActivity.java public class MainActivity extends AppCompatActivity { EditText inputMessage; TextView inputCount; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); inputMessage = findViewById(R.id.inputMessage); inputCount = findViewById(R.id.inputCount); Button s..
1장. URL 버튼 만들기
·
안드로이드/연습 코드
1. URL 버튼 만들기 1-1. activity_main.xml