Starting Chrome on a specific page using StartAndroidActivity
#1
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.
Reply
#2
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 :-)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
trial and error result:
Code:
StartAndroidActivity(com.android.chrome,,,http://www.google.com/)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
(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)
Reply
#5
(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.
Reply
#6
thx, i've added this info to the wiki.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Starting Chrome on a specific page using StartAndroidActivity00