I have implemented a chat activity and a search icon to search for texts. After entering the text, it will direct to another activity in order to display the texts. Now, I want to add a back arrow in my action bar or tool bar in order to go to the previous activity.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
var bundle: Bundle ? = intent.extras
query = bundle?.getString("query") as String
setSupportActionBar(chatSearchToolbar)
setContentView(R.layout.activity_chat_search)
loadQueryList(realm, query)
}
chatSearchToolBar is my tool bar in XML file. How do I implement it?