To summarize, so others don't have to trial and error all the details
above:

AndroidManifest.xml:
-------------------
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      package="test.current"
...
<activity
    android:name="test.another.MyActivity"
>
...

Java Code:
---------
package test.current
...
Intent i = new Intent();
i.setClassName("test.current", "test.another.MyActivity");
startActivity(i);

You can get the two names with:
String launcherPackage = this.getClass().getPackage().getName();
String launchedClass = test.another.MyActivity.class.getName();


Cheers,
Heliodor


On Nov 24, 4:43 am, String <[email protected]> wrote:
> I accomplish this by simply sending the intent to the other package +
> activity, e.g.:
>
>                 Intent intent = new Intent(Intent.ACTION_MAIN);
>                 intent.setComponent(new ComponentName("test.another",
> "test.another.MyActivity"));
>                 startActivity(intent);
>
> There's no connection between the manifests at all; the intent is
> simply passed via the system's usual mechanism, the same as if
> test.another.MyActivity had been started from the Launcher.
>
> String
>
> On Nov 24, 9:17 am, Tomas <[email protected]> wrote:
>
>
>
> > You are right, my manifest declares the package as "test.current", but
> > the activity as "test.another.MyActivity".
> > I have activities from multiple packages in the same manifest, ie:
>
> > <activity android:name="test.another.MyActivity>
> > <activity android:name="test.current.MyActivity>
>
> > Is that possible?
> > As far as I know one can't have multiple manifest files or multiple
> > "packages" defined in manifest for one application.
> > How do I achieve calling this activity "test.another.MyActivity" from
> > my activity in my default package "test.current" without splitting the
> > packages into two projects and two .apk-files?
> > How do other developers achieve this when fx including an Apache
> > licensed piece of software in your application?
>
> > Regards /Tomas

-- 
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

Reply via email to