I am asking how can my activity get notified that the back button has been pressed.
I know that I can override onBackPressed or onKeyEvenet accroding to this blog post
but i think this is not optimized way to do so, since I have to restart the previous activity my-self while the OS is already doing this for me.
I just need to be notified that back button is pressed to set a flag to be true where I can use this flag later to know if the hardware back button has been pressed or not
This is the best way to override the back button I know of, however that blog doesn’t explicitly say you can call the super method… Have you tried this?