I have project structure like
app:
InstantApp:
library:
dynamic-feature1:
dynamic-feature2:
dynamic-feature3:
Now there is some dependency between dynamic-feature1 and dynamic-feature2. Now if i add it as dependency in dynamic-feature2 build.gradle then it will cause cyclic dependency. Above is just one example there are many other cases too. How to handle such dependency conflicts properly or any suggestion?
Get a Fragment/Activity or other class from module:
method.invoke(objectYouWantToInvokeTheMethodOn);
Get a method from your class:
Method method = class.getMethod("GenerateQuestion");
Invoke the method:
method.invoke(objectYouWantToInvokeTheMethodOn);
To get a parent activity of a dynamic feature module's fragment you can do:
@Override public void onAttach(Context context) { super.onAttach(context); activity = (Activity) context; }
Then you can call a method on that activity.
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.