79383274

Date: 2025-01-24 05:20:11
Score: 2
Natty:
Report link

If you are a beginner, it is recommended to first understand the Android lifecycle:android_lifecycle.png

The relevant documentation is here: The android lifecycle

According to your needs, I think you need onPause.

If you want to be called when the user kills the app, then you need to handle it in onDestroy in MainActivity.

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: purofle