본문 바로가기

IT/Android100

Android] Fragment 생성시에는 newInstance로. All subclasses of Fragment must include a public no-argument constructor. The framework will often re-instantiate a fragment class when needed, in particular during state restore, and needs to be able to find this constructor to instantiate it. If the no-argument constructor is not available, a runtime exception will occur in some cases during state restore. 화면회전이나 화면 재생성으로 인해 Fragment 재생성시 no-a.. 2025. 1. 24.
Android] 안드로이드 스튜디오 미사용 코드 제거 미사용 코드, 미사용 리소스 제거하는 방법  Run inspection by name  unused resources unused declaration unused importunused symbol   키워드로 결과확인 후 제거 2024. 9. 8.
Android] PreviewView Pinch Zoom // 선언 ScaleGestureDetector detector;// detector 기능 정의@Override protected void onResume() { super.onResume(); ScaleGestureDetector.SimpleOnScaleGestureListener gestureListener = new ScaleGestureDetector.SimpleOnScaleGestureListener() { @Override public boolean onScale(@NonNull ScaleGestureDetector detector) { float currentZoomRatio = camera.getCameraI.. 2024. 8. 22.
Android] 안드로이드 프로젝트 패키지명 변경하기 1. 프로젝트 보기에서 상단 설정버튼   → Compat Middle Package 체크 해제  변경할 패키지명 우클릭 → Refactory →  Rename →  DO Refactor를 선택  2.build.gradle에서 applicationId를 변경할 패키지명으로 변경   끝 ~ 2024. 6. 23.