I'm making app that counts user's income and outcome. And recently I found out that if user has pressed home button from calculator(I use basic calculator, by android) than all data that he/she didn't save will be erased. How can I notify users about this so they could save all unsaved data? I want to show dialog when this happens but I don't know how to detect home button press. May be somebody had this issue too and could help me?
Thank you.