is there a way to save data on Android before quit?

Hey, i have a way to save the data of an android game. Now i dont want to Save the Data manually with a button, i want to always save the data before the User quits the Application. I though “OnApplicationQuit()” would do that work for me, but it doesnt.

You can check in update that if player pressed the escape button?
if he does, you can call save function, and after saving all data(Like with PlayerPrefs), Call Application.Quit at last of the save function, maybe like this:

void Update(){

void SaveData(){
save data logic