package com.globalbit.navigationtest2

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.NavigationUI
import com.globalbit.navigationtest2.R.id.my_toolbar
import com.globalbit.navigationtest2.R.id.nav_host_fragment
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        setSupportActionBar(my_toolbar)
        NavigationUI.setupActionBarWithNavController(this, NavHostFragment.findNavController(nav_host_fragment))
    }

    override fun onSupportNavigateUp()
            = NavHostFragment.findNavController(nav_host_fragment).navigateUp()
}
