Skip to content

Commit e31965e

Browse files
committed
fix : 알람 화면이 나오는 버그 픽스
1 parent 9247769 commit e31965e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

presentation/src/main/java/com/stop/MainActivity.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ class MainActivity : AppCompatActivity() {
2323
override fun onNewIntent(intent: Intent?) {
2424
super.onNewIntent(intent)
2525

26-
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
27-
val inflater = navHostFragment.navController.navInflater
28-
val graph = inflater.inflate(R.navigation.nav_graph)
29-
graph.setStartDestination(R.id.alarmStartFragment)
26+
intent?.extras?.getInt("ALARM_CODE")?.let {
27+
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
28+
val inflater = navHostFragment.navController.navInflater
29+
val graph = inflater.inflate(R.navigation.nav_graph)
30+
graph.setStartDestination(R.id.alarmStartFragment)
3031

31-
navHostFragment.navController.graph = graph
32+
navHostFragment.navController.graph = graph
33+
}
3234
}
3335

3436
override fun onCreate(savedInstanceState: Bundle?) {

0 commit comments

Comments
 (0)