Java – How do I get a broadcast receiver when manually terminating an application?

How do I get a broadcast receiver when manually terminating an application?… here is a solution to the problem.

How do I get a broadcast receiver when manually terminating an application?

I am working on an app to record phone unlocks. But I have a problem when my app is manually terminated, i.e. when you delete an app from a recent app. How do I record a broadcast when an app is killed?

I’m using ACTION_USER_PRESENT record unlock.

Solution

You need to create a service and create the broadcast receiver you need in this service.

This answer will definitely help you: Implement Broadcast receiver inside a Service

Related Problems and Solutions