STAR-ZERO / navigation-keep-fragment-sample

392 stars 63 forks source link

Adding action to keepStateFragment #1

Closed sgupadya closed 5 years ago

sgupadya commented 5 years ago

Is there a way to use both <fragment> tag and <keep_state_fragment> in the same navigation file. Also, the <action> tag under <keep_state_fragment> is creating crashes with the message: "navigation destination is unknown to this NavController". Is there any other way to add action to <keep_state_fragment>?

STAR-ZERO commented 5 years ago

You can use global action. https://developer.android.com/topic/libraries/architecture/navigation/navigation-global-action

However It's difficult to handle fragment back stack. 😞

STAR-ZERO commented 5 years ago

FYI: I added sample that fragment in tab navigates to another fragment.

sgupadya commented 5 years ago

Thanks will try that.

They haven't resolved this handling back stack issue in alpha-9 version also. :(

STAR-ZERO commented 5 years ago

Let me close. If you have anything, please create issue again.