I have the following project setup:
MyProjectApp/app/src/main/res/layout/main_activity.xml (layout1)
MyProjectApp/module1/src/main/res/layout/main_activity.xml (layout2)
Now in my module1
, when I try to do setContentView(R.layout.main_activity);
, it loads the layout from the app
. To fix this, I could rename my layout2 so that there is no name collision.
My problem is, when I release my module1
in AAR format, there is still the possibility of name collision because another project setup may name their own layout1
the same as my layout in the AAR.
Well, I could rename my layout2
to a very random name but I don't want that. I want a simple layout name such as main_activity.
So the question is, how can I make sure that when I do setContentView(R.layout.main_activity);
inside module1
, it loads the layout2
file?