Issue
Is there any way to navigate to a certain fragment from another dynamic module and not navigate to the start destination? If not, what are the alternatives?
<fragment
android:id="@+id/loginFragment"
android:name="com.example.feature.login.presentation.LoginFragment"
android:label="LoginFragment">
<action
android:id="@+id/actionLoginToHome"
app:destination="@id/featureHomeNavGraph" />
</fragment>
<include-dynamic
android:id="@+id/featureHomeNavGraph"
app:graphResName="feature_home_nav_graph"
app:moduleName="feature_home" />
While this code works fine, it navigates me to the start destination but I need to navigate to another one.
Solution
Solution 1: Navigate to specific fragment and do not use <include-dynamic>
<fragment
android:id="@+id/profileDetailsFragment"
android:name="com.example.feature.profiles.presentation.details.ProfileDetailsFragment"
android:label="Profile Details"
app:moduleName="feature_profiles" />
Solution 2: Create a new graph XML with different start destination.
Answered By - Nick Pampoukidis
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.