From aec9d75f7c1b5febcade7a483e02d4e5c6d3a4bb Mon Sep 17 00:00:00 2001 From: Joe Malin Date: Mon, 14 Feb 2011 10:29:12 -0800 Subject: [PATCH] DOC CHANGE: Fix bug 3448489 - Monkeyrunner example Change-Id: Ib997e9b0ef27a071c26774d139f19610404cdfbc --- .../guide/developing/tools/monkeyrunner_concepts.jd | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/html/guide/developing/tools/monkeyrunner_concepts.jd b/docs/html/guide/developing/tools/monkeyrunner_concepts.jd index d648b9355c6dd..658ff75d53bcb 100644 --- a/docs/html/guide/developing/tools/monkeyrunner_concepts.jd +++ b/docs/html/guide/developing/tools/monkeyrunner_concepts.jd @@ -110,8 +110,17 @@ device = MonkeyRunner.waitForConnection() # to see if the installation worked. device.installPackage('myproject/bin/MyApplication.apk') -# Runs an activity in the application -device.startActivity(component='com.example.android.myapplication.MainActivity') +# sets a variable with the package's internal name +package = 'com.example.android.myapplication' + +# sets a variable with the name of an Activity in the package +activity = 'com.example.android.myapplication.MainActivity' + +# sets the name of the component to start +runComponent = package + '/' + activity + +# Runs the component +device.startActivity(component=runComponent) # Presses the Menu button device.press('KEYCODE_MENU','DOWN_AND_UP')