I don't know how to detect when a user plug his headset in the phone when the app is closed or killed. I can do this when the app is running but i want to be able to do this when its closed. I think I have to make a Broadcast Receiver into my service but I don't know how to do it... Thanks for help, A french developper who is trying to speak english
EDIT: I am on Android Studio