Monday, April 18, 2011

[android-developers] How declare in AndroidManifest when one application have two packages

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?

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate