skip to Main Content

Android Studio – private lateinit var binding: ActivityMainBinding Not Working?

class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding private lateinit var navController: NavController override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root) navController = Navigation.findNavController(this, R.id.bottom_nav_control) setupWithNavController(binding.bottomNavigationView, navController) } } Here,private lateinit var binding: ActivityMainBinding not working?!…

VIEW QUESTION

Android Studio – Up Navigation in android

When I'm pressing the back button on phone or the support action bar, it's exiting the application. How can I fix it to return to the main activity In login code: override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_login) supportActionBar?.setDisplayShowHomeEnabled(true) ....…

VIEW QUESTION
Back To Top
Search