Android风味意图活动 [英] Android Flavor Intent Activity
本文介绍了Android风味意图活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何根据口味创建活动意图?
How to create an intent to an activity depending on the flavor?
层次结构:
main
-ActivityA
flavor(free)
-uses main/ActivityA
flavor(paid)
-uses own paid/ActivityA
那么如何根据当前口味创建一个Intent?
So how to create a Intent depending on the current flavor?
推荐答案
您可以通过其名称获取Activity类.这样,您就不会出现编译错误:
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"))
这篇关于Android风味意图活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文