Search code examples
androidandroid-tabhost

Referencing another package activity within a tab host


I've created an app that has been in the android marketplace for a few months now. I'm trying to create a complimentary app that will be used inside the first app. I need the second app to be optional, and not necessary for the first app to work properly. I'm hoping to call the main activity from the second app within a Tab Host tab on the first app.

My questions are: how do I run an activity from a secondary app with a different package? Is it possible to have the activity be in a tab host?

I'd be happy to post code, but my code seems to be nowhere close to what I'm trying to get. I don't think I can adjust the build path of the primary app, because the secondary app can't be required. Also, Since the app has been in the marketplace for a while, I can't use SharedUserIds.

Thanks for all help. TJ


Solution

  • It is not possible to do it to run any arbitrary activity in your app.

    I have done this before, with activity group, which has been already deprecated. And there are also limitations to use this approach:

    1. Your app has the same UID with the target package.
    2. Your app has system UID

    If you met either condition list above, you can start the child activity and get its window root view, and add into your layout.