From ee40699a8296682ed564daf4d1d91cec7f228120 Mon Sep 17 00:00:00 2001 From: Nguyen Van Tan Date: Sat, 2 Oct 2021 15:12:21 +0700 Subject: [PATCH] Update documentation --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 38a18b4..3937501 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,26 @@ class MainActivity : AppCompatActivity() { } } ``` +### Step 4: Navigate to other screen +- Example 1: just open Screen1 +```kotlin + navController.navigate(Screen.Screen1.route) +``` +- Example 2: pass random number to Screen2 +```kotlin + navController.navigate( + Screen.Screen2.setParam( + Screen2Argument( + Random.nextInt( + 0, + 50 + ) + ) + ) + ) +``` + + ### Note - You can get Argument object from arguments (Instance of Bundle) like example above. Or get data from SavedStateHandle like this