Android(60)
-
[ERROR/EXCEPTION] java.lang.IllegalArgumentExceptionNavigation action/destination package:id/CNestedFragment cannot be found from the current destination a(package:id/bNestedFragment) label=BNestedFragment class=package.ui.common.BNestedFragment
[이슈] navigation 시 app crash [원인] netsted graph는 startDestination만을 통해 접근 가능 Nested Graph Fragment -> Root Graph Fragment : O Root Graph Fragment -> Nested Graph Fragment : X 명시적으로 navigate한 경우 발생하는데, 내 프로젝트의 경우 state에 따른 타이밍 이슈 때문에 발생함 [재현 조건] 초기 Navigation BackQueue : Root Graph - Nested Graph - AFragment 중간 Navigation BackQueue : Root Graph - Nested Graph - AFragment - CFragment 종결 Navigation ..
2023.07.18 -
[ERROR/EXCEPTION] java.lang.IllegalArgumentExceptionNo destination with ID 2131361846 is on the NavController's back stack. The current destination is null
[이슈] navigation 시 app crash [원인] Lifecycle 이슈(NavGraphViewModel은 navigation graph에서 backstackEntry를 가져오는데 Activity에서 아직 Navigation.setGraph()가 불리기 전에 viewModel이 초기화되어 생기는 문제) [재현 조건] Activity 백그라운드에서 제거됨 Activity onCreate에서 Navigation.setGraph() 호출 NavGraphViewModel 사용 [해결] Activity.onCreate() 에서 Navigation.setGraph() -> activity_main.xml로 이동 viewModel 접근을 onViewCreated()에서 하면 됨 참고>https://battl..
2023.07.14 -
DeepLink(feat.Navigation Dynamic Link 설정)
- DeepLink : 앱에서 원하는 페이지로 이동할 수 있도록 제공하는 링크- Deep Link 종류Uri Scheme : scheme 설정을 통해 앱으로 연결하는 초기 형태App Link(Android) / Universal Link(IOS) : 웹 사이트 형태(고유 웹사이트, 즉 개별 서버 구성 + 인증 필요 방식)Dynamic Link : Firebase에서 제공하는 딥링크 지원 sdk- Deep Link 동작 방식일반 Deep Link : 클릭 시 앱으로 이동Deferred Deep Link : 앱이 설치되어 있는 경우 앱으로 이동 / 앱이 미설치된 경우 앱스토어 설치 페이지로 이동참고 url > https://medium.com/prnd/%EB%94%A5%EB%A7%81%ED%81%AC%EC%..
2023.07.13 -
Kotlin Style Guide vs. Android Studio Lint & Coding Style
1. source file UTF-8 encoding 2. directory structure is on source root and the location need to also match 3. source file name should be same with single class or cover the functional purpose with PascalCase and .kt extensions(recommend avoid meaningless words lie Utils) 4. source file size remains reasonable(not exceeding a few hundred lines) and avoid creating files just to hold all extensions..
2022.04.23 -
Lint - Android Studio 내장 Lint vs. Ktlint
Lint : 정적 소스 분석기로 구조적 품질 문제를 식별하고 수정할 수 있음 Linting is the automated checking of your source code for programmatic and stylistic errors. This is done by using a lint tool (otherwise known as linter). A lint tool is a basic static code analyzer. https://www.perforce.com/blog/qac/what-lint-code-and-why-linting-important What Is Lint Code? And Why Is Linting Important? | Perforce Software Linting is..
2022.04.23 -
Navigation
- 구성요소 Navigation Graph : navigation 정보를 담은 xml 파일 NavHost : Navigation Graph의 목적지를 보일 빈 컨테이너 NavController : NavHost 안에서 navigation을 관리 - Navigation Graph 설계 1. Destination 추가 1-1. Fragment 1-2. DialogFragment ... ... 1-3. Activity : 기본적으로 Navigation Graph는 ActivityScope에서 유효하므로, Activity Destination 추가는 현재 그래프의 endpoint로 사용됨 - startActivity()와 같은 맥락 - 암시적 Intent와 같은 맥락 : 찾지 못한 경우, ActivityNotF..
2022.04.19