Start activities or services in my other B4A apps.

bluedude

Well-Known Member
Licensed User
Longtime User
For some reasons I cannot seem to start activities or services in my other B4A apps.

Service
i.Initialize("", "")
i.SetComponent("nl.thingsio.apps.push/nl.thingsio.apps.push.svcpush")
StartService(i)

Activity
i.Initialize (i.ACTION_MAIN,"nl.thingsio.apps.push")
StartActivity(i)

Any suggestions?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should change the activity intent to:
B4X:
i.Initialize ("", "")
i.SetComponent("nl.thingsio.apps.push/nl.thingsio.apps.push.<activity_name_lower_case>")
StartActivity(i)

There is no problem with starting an external activity.

About the service, instead of starting the service directly you can send a broadcast intent and start the receiver that is tied to the service.
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
Kind of a cross-post, but I am trying to do this exact thing with my app but I am getting permission denial errors.

Please see my other post here.
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
Nevermind. I got it straightened out. All I had to do was add the following the manifest of the target app:

B4X:
SetActivityAttribute(FavsGuide, android:exported, "true")
 
Upvote 0
Top