Hi. The problem is simple.
The Main app starts a service, which is a derivation from Sensor example, found in the documentation.
Inside the SensorChanged sub, I do a check on the values.
When a condition is met, I stop the sensor and want to ask something to user.
To do this, I need to load a Layout etc. So I need to call a sub in the Main.
This is rather simple and works, no question, if the Main is active.
Instead, if the Main is paused, the sub in the main is not called.
To verify this, I put a Log message, like Log("Calling sub"), before the CallSub, another Log("Inside sub") inside the called Sub.
In the Log list on the right, first message is shown, second not.
I guessed that solution was simply to StartActivity(Main) if it was paused, as reported in other posts and as you say, but this doesn't happen to me.
Perhaps it could depend on being the CallSub issued inside the SensorChanged sub, which must be a particular one, being that no debug breakpoint can be put inside it.
I am running a 4.1.2 version of Android.
Thanks for your interest.
Giovanni