일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Android Apk
- error
- java error
- release Apk
- Kotlin
- Firebase
- R프로그래밍
- Exception
- spring
- tomcat
- html
- 안드로이드
- Eclipse
- MySQL
- Java
- fragment
- android fragment
- FLUTTER
- Android Apk 이름 변경
- Program type already present
- Android
- DataTable
- release unsigned
- CSS사용법
- jQuery
- android error
- Android Apk 이름
- css
- JavaScript
- apache gzip
- Today
- Total
목록android fragment (3)
selfstarter
# layout - activity_main.xml ``` xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > ``` - fragment_detail.xml ``` android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" androi..
fragment add, replace add는 activity에 기존 fragment는 놔두고 추가하는 것. onDetch를 호출하지 않을 때도 있다고 한다. 그리고 같은 fragment를 add할 시 에러 발생 replace는 기존 fragment를 변경하는 것. add, remove를 같이 쓰는게 번거로워 보여 간편하게 replace 사용 fragment backstack 현재 실행하려는 트랙잭션의 상태를 기억한다. 스마트폰의 back key를 통해 프래그먼트를 이전 상태로 되돌릴 수 있다 만약 activity가 하나이고 fragment만 이동하는 구조라면 스마트폰 back key 설정을 하지 않으면 앱을 나가버린다 replace 다음에 addToBackStack 함수만 호출하면 된다 public ..
XML에 선언된 Fragment Java객체로 가져오기 android.app.Fragment 사용 시 Fragment fragment = getFragmentManager().findFragmentById(R.id.fragment); androidx.fragment.app.Fragment 사용 시 Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_list);