일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 계측
- livedata
- binding
- 앱
- Kotlin
- DART
- data
- intent
- 테스트
- TEST
- viewmodel
- android
- activity
- appbar
- 안드로이드
- drift
- Dialog
- CustomScrollView
- Button
- tabbar
- LifeCycle
- textfield
- textview
- Coroutines
- 앱바
- scroll
- Compose
- Navigation
- ScrollView
- Flutter
- Today
- Total
목록fragment (2)
Study Record
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bx00IK/btslCkDFaY4/EK6b7rYVam8UgGvcpIYO01/img.png)
😶 개요 Fragment 사이의 데이터 전달은 Bundle 을 이용한다. Bundle 을 사용하면 key, value 값으로 데이터를 저장하면 해당 Fragment 에서 argmnent 변수로 Bundle 객체를 참고할 수 있다. Bundle 객체로 Fragment 로 데이터 전달하기 val bundle = Bundle().apply { this.putInt("test1", 3) this.putString("test2", "testtest") } StartFragment().apply { arguments = bundle } 전달받은 데이터 해당 Fragment 에서 확인하기 arguments?.getInt("test1") arguments?.getString("test2") 하지만 Bundle 객체를 ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/nxnTF/btskKE3l6xW/COMHH7irseCFaZLOUJNmj1/img.png)
😶 Fragment Fragment 는 앱 화면에서 사용자와 상호작용할 수 있는 한 부분으로 ViewGroup 에 속한다. Activity 에 여러 개의 Fragment 가 존재할 수 있고 여러 개의 Activity 에 하나의 Fragment 를 재사용할 수 있다. 항상 Activity 내에서 호스팅 되어야 한다. 자체 생명 주기를 가지고 자체 입력 이벤트를 수신하며 Activity 실행 중 추가 및 삭제가 가능하다. Activity 가 관리하는 백 스택에도 Fragment 를 추가할 수 있다. (ex. 뒤로 가기 버튼을 누르면 액티비티가 종료하는 것이 아닌 이전 Fragment 가 나오는 경우) 😶 Fragment 수명주기 프래그먼트의 수명 주기는 왼쪽 그림과 같다. 그 중 최소한 구현해야 하는 수명 ..