2013-03-15 95 views
0

我需要在設備中啓動瀏覽器。瀏覽器活動不起作用

Android版本是4.1

下面的行不工作,這是寫在monkeyrunner

device.startActivity(component='com.google.android.browser/.BrowserActivity', uri=url) 

回答

0

試試這個: -

PACKAGE = 'com.android.browser' 
ACTIVITY = '.BrowserActivity' 
COMPONENT = PACKAGE + "/" + ACTIVITY 
URI = 'www.google.com' 
device.startActivity(component=COMPONENT, uri=URI) 
1

要打開一個URL /網站,你做到以下幾點:

String url = "http://www.example.com"; 
Intent i = new Intent(Intent.ACTION_VIEW); 
i.setData(Uri.parse(url)); 
startActivity(i); 
+0

is th適用於monkeyrunner? – 2013-03-15 05:38:24

相關問題