You cannot construct a ComponentName for "com.android.two", as there is no "com.android.two". Just because you have a Java package does not mean it is an Android application package.
To fix this: Step #1: Replace "com.android" with some name that you own, please, as I really doubt that you own Google or the Open Handset Alliance Step #2: Replace "com.android.two" in the first parameter of the ComponentName constructor with whatever you change "com.android.one" to On Mon, Apr 18, 2011 at 9:44 AM, a a <[email protected]> wrote: > Dear all, > > I have two packages "com.android.one" and "com.android.two". the first > package have on activity, and package two have an activity name for > activityA > > AndroidManifest.xml following > <manifest > xmlns:android="http://schemas.android.com/apk/res/android" > package="com.android.one"> > ...... > ...... > > <activity android:name="com.android.two.activityA"></activity> > ..... > ..... > > > My code following > > ComponentName componentName = new ComponentName("com.android.two", > "com.android.two.activityA"); > > Intent intent=new Intent(); > intent.setComponent(componentName); > intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); > startActivity(intent); > > > Error log following > > 03-03 20:10:17.217: ERROR/HelloYoumi(16917): Unable to find explicit > activity class {com.android.two/com.android.two.activityA}; have you > declared this activity in your AndroidManifest.xml? > 03-03 20:10:17.217: INFO/ActivityManager(202): Starting: Intent { > flg=0x10000000 cmp=com.android.two/.activityA } from pid 16917 > > So, it seams error declared in AndroidManifest.xml, How can i declare > in AndroidManifest.xml? -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in London: http://bit.ly/smand1, http://bit.ly/smand2 -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

