-1

I have seen many different solutions to add the back button in the Toolbar and then implement the behaviour through code. However, I was wondering if there is any way to add the button and implement its behaviour only using XML. For example, using a specific Android Theme?

Thanks.

11_22_33
  • 116
  • 1
  • 15

1 Answers1

1

By using a theme you can't achieve this. If you want to achieve only through XML, try adding a toolbar and inside keep a container layout (Relative or Linear) and add ImageButton with a back arrow vector. Give an onClick handler to it and implement the logic in the method.