0

I need to launch the browser in the device.

The android version is 4.1

The line below isn't working, It's written in monkeyrunner

device.startActivity( component='com.google.android.browser/.BrowserActivity', uri=url)
srh snl
  • 797
  • 1
  • 19
  • 42

2 Answers2

1

To open a URL/website you do the following:

String url = "http://www.example.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
Tuan Vu
  • 6,397
  • 2
  • 14
  • 22
0

Try this:-

PACKAGE = 'com.android.browser'
ACTIVITY = '.BrowserActivity'
COMPONENT = PACKAGE + "/" + ACTIVITY
URI = 'www.google.com'
device.startActivity(component=COMPONENT, uri=URI)
Rilwan
  • 2,251
  • 2
  • 19
  • 28