XxGoliathusxX XxGoliathusxX - 4 days ago 5
Android Question

Android Flavor Intent Activity

How to create an intent to an activity depending on the flavor?

Hierarchy:

main
-ActivityA

flavor(free)
-uses main/ActivityA

flavor(paid)
-uses own paid/ActivityA


So how to create a Intent depending on the current flavor?

Answer

You can get Activity class by it's name. This way you won't get compile errors:

Intent i = new Intent(this, Class.forName("com.xxx.packagename.paid.ActivityA"))
Comments