I am trying out youtube video to be played on my app. I understand this can be achieve by extending activity as YouTubeBaseActivity by doing this I don\'t have access to you
I was not interested in moving my already completed code to fragment for just adding a toolbar with a back button. So I figured out an easy way to do it.
Inside the layout xml I added a TextView which looks like a toolbar. Here's the code for the Textview. Also, you need to add a vector asset (back icon) in the drawable folder
And Simply adding onclicklistener on the textview for back press
val actionbarTitle = findViewById(R.id.actionbartitle)
actionbarTitle.setOnClickListener {
super.onBackPressed()
}
Here's how the final result look likes! Have your cup of coffee :)