Hello Jordi!
Thank you for your response.
I really haven't noticed that the autocomplete comment describes the functionality of StartActivity!
One more question:
What could I do to start an activity from a service? This is critical for my app functionality!
Thank you in advance!
However, unless your app really requires it, usually it is better to launch a notification and let the user decide if he wants to open the app or not by clicking on it (just as gmail, whatsapp or others do)
So, if you must launch for instance your main activity, just do it from your service
B4X:
StartActivity(main)
If it does not work when the screen is off, you could try this (not tested, taken from an old code where I did something similar with a transparent activity)
B4X:
Dim In As Intent
In.Initialize("","")
In.SetComponent("my.package.name/.my_activity_name") '<-- for instance "b4a.example/.main"
Dim FLAG_DISMISS_KEYGUARD as Int = 0x00400000
Dim FLAG_TURN_SCREEN_ON as Int = 0x00200000
In.Flags = Bit.Or(FLAG_TURN_SCREEN_ON, FLAG_DISMISS_KEYGUARD )
StartActivity(In)
However, I doubt (well, the exact sentence would be "I don't know at all") if CallSubDelayed will have the same effect as a Starting intent (with the corresponding flags) in case the screen is off (will try it later just out of curiosity)