How can I open a new Activity inside of a fragment when using a button?
I tried this
override fun onViewCreated(view: View, savedInstanceState: Bundle?
Try getting the context from the fragment instead
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
LogOut_btn.setOnClickListener {
//FirebaseAuth.getInstance().signOut()
val intent = Intent (view.context, Main::class.java)
startActivity(intent)
}
}