Let's say I have two layouts activity_home_1 and activity_home_2 for my HomeActivity.
I want to be able to switch between them like I used to do in Java:
int layout = getResources().getIdentifier("activity_home_" + getHomeScreenNumber(),"layout",getPackageName());
setContentView(layout);
And later reference elements of my layout using findViewById();
Of course, all the elements in those two layouts are named the same, they are just different looking, so this is working perfectly in Java.
On the other side in Kotlin, I'm avoiding findViewById() and I'm using Kotlin Android Extensions, and it's working great with including one layout like this:
import kotlinx.android.synthetic.main.activity_home_1.*
The trouble is when I want to switch between them. Just simply adding another import for the other layout it's causing an error because it doesn't know which layout to look at (cause they both have the same fields).
How can I switch between two layouts when using Kotlin Android Extensions?