You can't. You can either move from activity to activity or fragment to fragment. In the first case you can use the code you have implemented with
private fun onClickListener() {
profileImageView.setOnClickListener {
val i = Intent(this, SecondActivityWhatever::class.java)
startActivity(i)
}
}
otherwise you need to implement Navigation Component in order to move from fragment to fragment.
(Another option in your specific case would be using a Custom Fragment Dialog to show the profile)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.