I am developing application for Android 14 (34) (C# VS) and tried to make it be terminated by pressing a menu option. Using implemented an android location service GPS position of the device is continuously displayed on the map window.
As a user clicks exit option the location service is stopped and the app ceased to exist.
That is provided by the following code.
StopLocationService();
Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
It works properly when the exit option is pressed in the debug mode. But when the smartphone is disconnected the app can not be stopped is such a way completely. This manifests itself in the fact that in the Settings App info window the ‘Force stop’ button remains active. But in fact location service seems not to be working. At least it doesn’t send coordinates to some database like it does when it’s running.
Does anyone have any ideas on how to find a solution to this problem?