Kodi Community Forum

Full Version: Starting Chrome on a specific page using StartAndroidActivity
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using:

Code:
xbmc.executebuiltin(StartAndroidActivity(com.android.chrome))

in python to launch Google Chrome, all works good.

Are there any parameters I can add to specify the page I would like Chrome to start on?

I assume I have to use the intent parameter, but I can't for the life of me work out the syntax.
all i know is you can pass the following args to the command:
Code:
StartAndroidActivity(package,[intent,dataType,dataURI])

i have no clue what any of them mean though :-)
trial and error result:
Code:
StartAndroidActivity(com.android.chrome,,,http://www.google.com/)
(2016-03-19, 13:02)ronie Wrote: [ -> ]all i know is you can pass the following args to the command:
Code:
StartAndroidActivity(package,[intent,dataType,dataURI])

i have no clue what any of them mean though :-)

Cheers Ronie, minutes after posting and after lots of stabbing around in the dark an almost 100% unrelated thread pointed me in the right direction.

So just in case anyone else ever wants to know:

Code:
app      = 'com.android.chrome'
intent   = 'android.intent.action.VIEW'
dataType = ''
dataURI  = 'http://bbc.co.uk'

cmd = 'StartAndroidActivity("%s", "%s", "%s", "%s")' % (app, intent, dataType, dataURI)

import xbmc
xbmc.executebuiltin(cmd)
(2016-03-19, 13:28)ronie Wrote: [ -> ]trial and error result:
Code:
StartAndroidActivity(package,,,http://www.google.com/)

LOL Yes that works too, I guess the intent defaults to the VIEW type

Edit
However, I have just tried it without the intent and attempted to launch a different browser (com.android.browser) and that DOES need the intent setting.
thx, i've added this info to the wiki.