I am a newbie in B4A but i have studied the documentation a lot as i have searched the forum for hours.
I am trying to create a service that runs in the background. I realized that i can't display any info from the service but i have to inform the activity to display any data i want.
But how can i display a MsgBox when the service is running but the activity is paused? For example, i want to display a MsgBox (AlertDialog) every time the phone rings. I tried a lot to use Intent with ACTION_VIEW but with no success.
Thank you for the answer. I already know that ToastMessage is the only dialog that can be displayed from Service but i was wondering if there is any way to display MessageBox from an intent.
I have tried displaying e.g. WIFI_SETTINGS and it works but i don't know if this could happen with a MsgBox using an intent.
Hmm, i'm sorry, maybe i haven't completely understood the meaning of intents.
Is this display-only-from-Activity issue is only for B4A? Because there are plenty of apps that act as services, that display information like AlertDialogs with buttons and interact with the user.
CallSub is useful when the Activity is expected to be active. If not then it is easier to:
- Set a process global flag in the target activity
- Call StartActivity
- In Activity_Resume check this flag and then act accordingly.