Android Question Start App from Service Module

tomoshea

Member
Licensed User
Longtime User
Hi,
I have a service module that intercepts SMS messages from a particular number and updates a table in a database. That part works fine - now I want the service module to start another app whenever a message is received.

I cannot use something like

B4X:
Dim in As Intent
Dim pm As PackageManager

in = pm.GetApplicationIntent("com.xtralogic.android.rdpclient.trial")

If in.IsInitialized Then

   in.SetComponent("com.xtralogic.android.rdpclient.trial/.HelpActivity")

   StartActivity(in)   

End If

because when I add the phone library the following line
B4X:
If startingIntent.Action = "android.provider.Telephony.SMS_RECEIVED" Then
in
Sub Service_Start(startingIntent As Intent)

gives an error 'Unknown member:Action'

Any help would be greatly appreciated.
Thank you,
Tom
 

tomoshea

Member
Licensed User
Longtime User
Can you upload the project? The Phone library shouldn't have any effect on the Intent object.
I have made a small project to show the problem. I have included all the libraries that I currently use.
 

Attachments

  • ServiceTest.zip
    9.2 KB · Views: 203
Upvote 0
Top