I have an activity that has two layouts one in the folder layout
and the other one in
layout-large
, (one is for the phone factor and the other one for the tablet form). How
do I detect which layout is being loaded since in the tablet form I display more data?
Thanks
EDIT:
I know that in the tablet it will load the layout-large
but how do I know that I am running in something with a tablet form factor?
You can detect it programmatically:
(getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE;
getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
and with other methods and properties in getResources().getConfiguration()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With