Android Question Open Chrome to URL via Service

sweddle

Member
Licensed User
Hello,

I am about to write a app that will run as a service and I will need to it to open Chrome to a URL...

Can a Service do that??? (My thoughts are this may be seen by Android as some sort of virus and they don't allow that but I don't know.. thus I ask)

Thanks for any help on this
/Shane
 

NJDude

Expert
Licensed User
You can do it using an intent, like this:
B4X:
Private Browser As Intent

Browser.Initialize(Browser.ACTION_VIEW, "http://www.b4x.com")

Browser.SetComponent("com.android.chrome/com.google.android.apps.chrome.Main")

StartActivity(Browser)
Of course, you will have to verify Chrome is installed on the device.
 
Top