'Run_App' is a service write in B4A designed to be started automatically when the operating system is started and to wait for the receipt of sms
When the smartphone receives a text message, Run_App service reads the sms body, and if present the command START_PROG = com.peppe.app_1 starts the code to run the app whose package is com.peppe.app_1
Well, the program seems to work as intended but only if it is started manually and the focus is on the main form
If another app is launched and the focus switches to the latter, the Run_App program does not seem to work anymore
I inserted some log lines in it to understand if the sms is received, interpreted correctly, and the attempt to start com.peppe.app_1 is performed and in fact it is so, all the code seems to be executed correctly, but the app_1 program does not start
Then recap the line StartActivity (Pm1.getApplicationIntent (command))
it is definitely performed but has no effect
This only if the Run_App program is in the background, while if it is in the foreground then everything works correctly
The question is: why does the
StartActivity(Pm1.getApplicationIntent (command))
not start the requested app?
When the smartphone receives a text message, Run_App service reads the sms body, and if present the command START_PROG = com.peppe.app_1 starts the code to run the app whose package is com.peppe.app_1
Well, the program seems to work as intended but only if it is started manually and the focus is on the main form
If another app is launched and the focus switches to the latter, the Run_App program does not seem to work anymore
I inserted some log lines in it to understand if the sms is received, interpreted correctly, and the attempt to start com.peppe.app_1 is performed and in fact it is so, all the code seems to be executed correctly, but the app_1 program does not start
B4X:
Sub StartApp (command as string)
Dim Pm1 as PackageManager
StartActivity (Pm1.getApplicationIntent (command))
end sub
Then recap the line StartActivity (Pm1.getApplicationIntent (command))
it is definitely performed but has no effect
This only if the Run_App program is in the background, while if it is in the foreground then everything works correctly
The question is: why does the
StartActivity(Pm1.getApplicationIntent (command))
not start the requested app?
Last edited: