title: kotlin.TypeCastException: null cannot be cast to non-null type android.support.v7.widget.Toolbar
body: <p>I'm new to <code>Android</code> here. What can be the situation for my problem? I'm trying to present my fragment to the <code>MainActivity</code>. Any suggestions will help. Thanks</p>
  
  <p>Main Activity Class...</p>
  
  <pre><code>class NavigationActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.fragment_schedule)
  
          val toolbar = findViewById(R.id.toolbar) as Toolbar
          setSupportActionBar(toolbar) // setup toolbar
          toolbar.setNavigationIcon(R.drawable.ic_map)
  
          val drawer = findViewById(R.id.drawer_layout) as DrawerLayout
          val toggle = ActionBarDrawerToggle(
                  this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close)
          drawer.addDrawerListener(toggle) // navigation drawer
          toggle.syncState()
  
          val navigationView = findViewById(R.id.nav_view) as NavigationView
          navigationView.setNavigationItemSelectedListener(this) //setup navigation view
  
  }
  </code></pre>
  
  <p>My Fragment Class..</p>
  
  <pre><code> class fragment_schedule : Fragment() {
   override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?,
                                savedInstanceState: Bundle?): View? {
     // Inflate the layout for this fragment
     return inflater!!.inflate(R.layout.fragment_schedule, container, false)
  }
  </code></pre>