Ответ
В Android есть несколько способов навигации между экранами:
- Intent + Activity
val intent = Intent(this, SecondActivity::class.java)
startActivity(intent)
- FragmentManager + FragmentTransaction
supportFragmentManager.beginTransaction()
.replace(R.id.container, MyFragment())
.addToBackStack(null)
.commit()
- Jetpack Navigation Component
<fragment android:id="@+id/firstFragment"
app:destination="@id/secondFragment" />
findNavController().navigate(R.id.secondFragment)
- Deep Links
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="https" android:host="example.com" />
</intent-filter>
- ViewPager2 – для горизонтальной навигации (например, onboarding).
Выбор зависит от архитектуры: для простых приложений подойдут Activity/Intent, для сложных – Navigation Component.