The menu resource is inflated by and calling the inflate() method of MenuInflater class. Android Developers In menu.xml we will design the options menu as the requirement of the app. Ownership of the app bar varies depending on create a custom navigation drawer in Android override fun onCreateOptionsMenu(menu: Menu, menuInflater: MenuInflater) { menuInflater.inflate(R.menu.shr_toolbar_menu, menu) super.onCreateOptionsMenu(menu, menuInflater) } Note: If Android Studio encounters Cannot resolve symbol errors when writing this code, press Alt + Enter or (Option + Return on Mac) to import the missing symbols. The ActivityResultContracts class and its contracts have been rewritten in Kotlin to ensure the proper nullability.