We are currently working with flavors to create differing apps with the same codebase. I've run into this scenario:
I have two Apps, App A and App B. Inside src/main
, so in both flavors' scopes, I have an activity called Start_Activity
. From Start_Activity
, I want to move to either A_Activity
or B_Activity
, based on which app we're in. A_Activity
and B_Activity
are only in the scope of their respective flavors.
What's the best way of attempting this? I don't want to move Start_Activity
into the separate flavors, since that'd defeat the point of reusing code.
Can I resolve an activity class for an Intent
from ressource files or from the manifest? Or can I only create a class with same-named-constants that exists in each flavor?
Edit
I neglected to mention that I specifically don't want to use a method where the activities share the same name and only exist in the scope of their respective flavors (for example, renaming both A_Activity
and B_Activity
to X_Activity
).
I don't want to use this because I could run into the situation where I have App C that also wants to use A_Activity
. Using this method, I'd have to have the A_Activity
file in both flavors for App A and App C, which is not clean enough for what I want to do.