Kodi Community Forum
Starting Chrome on a specific page using StartAndroidActivity - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Android (https://forum.kodi.tv/forumdisplay.php?fid=164)
+---- Thread: Starting Chrome on a specific page using StartAndroidActivity (/showthread.php?tid=265016)



Starting Chrome on a specific page using StartAndroidActivity - spoyser - 2016-03-19

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.


RE: Starting Chrome on a specific page using StartAndroidActivity - ronie - 2016-03-19

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 :-)


RE: Starting Chrome on a specific page using StartAndroidActivity - ronie - 2016-03-19

trial and error result:
Code:
StartAndroidActivity(com.android.chrome,,,http://www.google.com/)



RE: Starting Chrome on a specific page using StartAndroidActivity - spoyser - 2016-03-19

(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)



RE: Starting Chrome on a specific page using StartAndroidActivity - spoyser - 2016-03-19

(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.


RE: Starting Chrome on a specific page using StartAndroidActivity - ronie - 2016-03-19

thx, i've added this info to the wiki.