You can set a different android:tag
attribute on the views in each different resource file, and read the tag back at runtime with View.getTag()
.
Example:
layout-xlarge-land/my_act.xml
<View
android:id="@+id/mainview"
android:tag="xlarge-landscape"
/>
layout-xlarge/my_act.xml
<View
android:id="@+id/mainview"
android:tag="xlarge-portrait"
/>
MyActivity.java
String tag = view.getTag();
if (tag.equals("xlarge-landscape") {
...
}