简体   繁体   中英

Dynamic Application Flow for different flavours of Android application

I tried looking if this question has been answered before but I can't seem to find an answer. I'm trying to build an application with dynamic application flow. What I mean by dynamic is, the application flow is different for each flavour of the application. For example, Application A will have a flow of Activity A -> Activity B -> Activity C. Application B will have Activity A -> Activity C -> Activity A.

Basically, I'm looking for a way to manage/configure the Activity/Application flow for different build flavors. Is there a way to do this via the manifest file or the build.gradle file? Or do I need to create a class containing the flow I want and reference that file from each Activity? Thanks

Simply you can create a Navigation controller class for each of your flavours and control your app navigation with it. You can seperete and manage them with source sets. With this you can use different navigation controllers for each of your product flavor and have different navigation logic for your flavours.

Here's a doc about source sets. https://docs.gradle.org/current/dsl/org.gradle.api.tasks.SourceSet.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM