Android

Android Navigation

Navigation Component, NavController, SafeArgs, Deep Links, Bottom Navigation, Drawer

26 câu hỏi phỏng vấn·
Junior
1

What is Jetpack's Navigation Component?

Câu trả lời

Navigation Component is a Jetpack library that simplifies navigation between destinations (fragments/activities). It offers automatic back stack management, SafeArgs for type-safe arguments, navigation graph visualization, and handles deep links. It's Google's recommended solution for navigation in modern Android apps.

2

What is a Navigation Graph?

Câu trả lời

A Navigation Graph is an XML file (stored in res/navigation/) that visually defines all navigation destinations (fragments, activities) and transition actions between them. It allows visualizing the app's navigation flow and defines arguments passed between destinations. It's the central file of Navigation Component.

3

What is the NavController?

Câu trả lời

NavController is the central object that manages navigation within a NavHost. It allows navigating between destinations (navigate()), going back (popBackStack()), and managing the back stack. It's obtained via findNavController() from a Fragment or Navigation.findNavController(view). It executes actions defined in the Navigation Graph.

4

What is the NavHost?

5

How to navigate to a destination with NavController?

+23 câu hỏi phỏng vấn

Nắm vững Android cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí