'how to use another nav host inside the navigation without using using another activity

I have a fragment which is also a part of navigation name basic details fragment

and I want to use another navhost container inside this fragment, How can I do that how I can access this navhost inside the BasicFragment or it is possible? if any one know please share the info thank you :)

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background_gradient"
    tools:context=".ui.authentication.register.fragment.BasicDetailsFragment">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/_8sdp"
        android:text="@string/registration"
        android:textColor="@color/white"
        android:textSize="@dimen/_16sdp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/_40sdp"
        android:background="@drawable/top_rounded_corner_shape"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <!--<fragment
            android:id="@+id/registrationNavHost"
            android:name="androidx.navigation.fragment.NavHostFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:defaultNavHost="true"
            app:navGraph="@navigation/registration_graph" />-->

        <com.aceinteract.android.stepper.StepperNavigationView
            android:id="@+id/stepper"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/_20sdp"
            app:stepperIconSize="@dimen/_20sdp"
            app:stepperItems="@menu/onboarding_steps_menu"
            app:stepperType="tab_numbered" />

    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source