It looks as if your component name is incomplete. It looks as if you
provided a Java package name, but not the Android package name for
your application.

A component name is not a "path" to the application, nor is it an
Android package name or a Java package ID. It *looks like* a Java
package ID, because Android chose to use that form as a way of
uniquely identifying application packages.
Though this is confusing, it does make sense. Just as it's easy to
build a unique URI just by using a name that's unique to you, so is it
easy to build a unique Java package ID or Android package name.

I prefer to use "Java package ID" to refer to the string that comes
after an "import" statement, and Android package name to refer to the
value of the "package" attribute in the <manifest> element of
AndroidManifest.xml. They have the same syntax, but they mean
different things.
The Java ID is a fully-qualified class identifier; the package name is
a unique identifier for your *application*.

The "component" parameter to startActivity has to be the fully-
qualified name of an Android Activity in your application. Fully-
qualified means that it has to contain the package name for your
application and the fully-qualified class name for your Activity.
The form is

<packagename> + "/" + <activityname>.

For example, if your <packagename> (the value of the "package"
attribute of the <manifest> element in your AndroidManifest.xml) is
"com.example.test.application" and
your main Activity class name "MainActivity" in the Java package
"com.example.myapp" then the component name is

com.example.test.application/com.example.myapp.MainActivity

Component names are not discussed all that much in Android, but
they're very important, since they are a complete and unique
identifier for an Android component (Activity, content provider, etc.)
in the system.

If you want to learn a bit more, look at the javadoc for
android.content.ComponentName.

kle.

On Feb 4, 4:23 pm, RonQ <ronquin...@gmail.com> wrote:
> Good information.  Thanks.  I'm not using a specific notepad example
> to launch my app.  Instead I'm using our own internal app.  I have
> access to the code, but how do you know what path to provide to the
> application?  I've tried some that I thought would work, such as our
> SplashScreen, but my app never comes up.  It does the navigation on
> the device, but just without my app running.  I just navigates though
> my phone menu.
>
> I'm making the same call like this
> device.startActivity(component='com.myapp.SplashScreen')
>
> How does one know what can actually be called with the startActivity
> component call?  Any help would be appreciated.
>
> On Jan 11, 10:30 pm, "Hakbong Kim haknal...@gmail.com"
>
>
>
>
>
>
>
> <haknal...@gmail.com> wrote:
> > Your code works.
> > Thanks for your help.
>
> > On 1월7일, 오전6시10분, "A. Elk" <lancaster.dambust...@gmail.com> wrote:
>
> > > Uh, I think the beginning example in theMonkeyRunnerdocumentation is
> > > wrong. The initial snippet is very misleading. Someone should report
> > > that as a bug.
>
> > > Your code listing doesn't show that you installed the package that
> > > contains the component you want to start. I assume that you either
> > > installed it before you ranMonkeyRunner, or that you left this out of
> > > your listing.
>
> > > The syntax of the "component" parameter is the same as that for an
> > > Android ComponentName: package_name/class_name. Package_name is the
> > > Android package name of the .apk containing your application. In your
> > > example, assuming that you're using the Note Pad sample app as your
> > > application, it's com.example.android.notepad. Class_name is the name
> > > of a class that Android can start; it's almost always an extension of
> > > android.app.Activity. For the Note Pad sample app, you would probably
> > > use com.example.android.notepad.NotesList.
>
> > > To ensure you're not doing something wrong, remember to install the
> > > package, then try using this code snippet:
>
> > > packagename = "com.example.android.notepad"
> > > classname = "com.example.android.notepad.NotesList"
> > > componentname = packagename + "/" + classname
> > > device.StartActivity(component=componentname)
>
> > > On Jan 6, 12:28 am, "Hakbong Kim haknal...@gmail.com"
>
> > > <haknal...@gmail.com> wrote:
> > > > I tried to usemonkeyrunner.
> > > > A target is Android vmware image.
> > > > I checked that press(), takeSnopshot() and drag() are normally
> > > > executed.
> > > > But, startActivity() is not executed.
>
> > > > The first source code is
>
> > > >      from com.android.monkeyrunnerimportMonkeyRunner, MonkeyDevice
> > > >      device =MonkeyRunner.waitForConnection()
>
> > > > device.startActivity(component='com.example.android.notepad.NotesList')
>
> > > > The second is
> > > > ( I modified a third line referring to a writing of this group )
>
> > > >      from com.android.monkeyrunnerimportMonkeyRunner, MonkeyDevice
> > > >      device =MonkeyRunner.waitForConnection()
> > > >      device.startActivity(component='com.example.android.notepad
> > > > \.NotesList')
>
> > > > In two cases, the result is same
>
> > > > 110106 17:13:42.168:I [main] [com.android.monkeyrunner.MonkeyManager]
> > > > Monkey Command: wake.
> > > > 110106 17:13:42.310:I [main] [com.android.monkeyrunner.MonkeyManager]
> > > > Monkey Command: quit.
>
> > > > I tried using startActivity() with other activities. But, the result
> > > > is same.
> > > > What is right arguments for startActivity() ?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to