Open Activity to Fragment in kotlin with Android Studio.
Jun 14, 2021
We have studied Activity and Fragment. So We will know about its activity. how to open Activity from Fragment.
Firest We will create a new fragment and Will call the id of the button on which the fragment is to be opened, its activity, and setOnClickListener to open the fragment of that order
val ambulanceAmChecking = view.findViewById<ImageView>(R.id.ambulanceAmChecking_imageView)
ambulanceAmChecking.setOnClickListener {
val intent = Intent(activity,DriverVerificationDetailsActivity::class.java)
startActivity(intent)
}
return view