Senior Software Engineer @ Originate
<fragment
android:id="@+id/homeFragment"
android:name="org.ocandroid.navigationdemo.HomeFragment"
android:label="@string/title_home"
tools:layout="@layout/fragment_home" >
<deepLink android:id="@+id/ocAndroidDeepLink"
app:uri="www.ocandroid.org/{bundleArg}"/>
</fragment>
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<nav-graph android:value="@navigation/nav_graph" />
</activity>
val options = NavOptions.Builder()
.setPopUpTo(R.id.splash, true // inclusive
).build()
findNavController().navigate(R.id.action_splash_to_home,
null, // bundle args
options)
<action
android:id="@+id/action_splash_to_home"
app:destination="@id/home"
app:popUpTo="@id/splash"
app:popUpToInclusive="true"/>
<navigation 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:id="@+id/navGraph"
app:startDestination="@id/homeFragment">
<fragment
android:id="@+id/homeFragment"
android:name="org.ocandroid.navigationdemo.HomeFragment"
android:label="@string/title_home"
tools:layout="@layout/fragment_home" />
<navigation android:id="@+id/registration_graph"
app:startDestination="@id/signupFragment">
<fragment android:id="@+id/signupFragment"
android:name="org.ocandroid.navigationdemo.SignupFragment"
android:label="@string/title_signup"
tools:layout="@layout/fragment_signup"/>
</navigation>
</navigation>