Home > Enterprise >  How to move from an activity to a fragment in kotlin
How to move from an activity to a fragment in kotlin

Time:12-26

I have a fragment and when clicking on a button I move to an activity ,and while back pressed from that activity I want to move back to that fragment ? How to do that in kotlin

I need to move from an activity to a fragment

CodePudding user response:

You need context in order to move from Fragment to Activity. For that you can get context from Fragment's parent activity and then open another activity.

Follow this thread to get better idea.

CodePudding user response:

You can use Navigation Component library for better navigation between screens.

  • Related