返回 Skill 列表
extension
分类: 开发与工程无需 API Key

Android Navigation

使用Jetpack Compose导航和应用链接进行Android导航。在实现Android中的导航流程、深度链接或回退栈处理时使用。

person作者: jakexiaohubgithub

Android Navigation (Jetpack Compose)

Priority: P2 (MEDIUM)

Guidelines

  • Library: Use androidx.navigation:navigation-compose.
  • Type Safety: Use sealed classes for routes, never raw strings.
  • Deep Links: Configure intent-filter in Manifest and deepLinks in NavHost.
  • Validation: Validate arguments (e.g., proper IDs) before loading content.

Anti-Patterns

  • No String Routes: Use Screen.Product.route instead of "product/$id".
  • No Unvalidated Deep Links: Check resource existence before rendering.
  • No Missing Manifest: Deep links require autoVerify=true intent filters.

References