Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
see: #51
  • Loading branch information
qdsfdhvh committed Aug 13, 2021
1 parent f11f680 commit bcd8218
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
proxyFragmentFactory()
// with java
// Fragivity.proxyFragmentFactory(this)

super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

Expand All @@ -91,6 +94,8 @@ class MainActivity : AppCompatActivity() {
}
```

> !Note: Add `proxyFragmentFactory()` to ensure that the fragments can run to `onStart/onStop`,before `super.onCreate()`
### 3. navigate to destination Fragment

```kotlin
Expand Down
6 changes: 6 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ Like `Navigation`, Fragivity needs a `NavHostFragment` as the host of ChildFragm
class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
proxyFragmentFactory()
// with java
// Fragivity.proxyFragmentFactory(this)

super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

Expand All @@ -96,6 +100,8 @@ class MainActivity : AppCompatActivity() {
}
```

> !Note: 添加`proxyFragmentFactory()`确保fragments正常走到`onStart/onStop`,放在`super.onCreate()`之前
### 3. navigate to destination Fragment

```kotlin
Expand Down

0 comments on commit bcd8218

Please sign in to comment.