I am developing android program that have a lot of supported screen sizes and I have different layout for each screen , but some layout have extra buttons and views so I want to change the code according to the current used device for example when I use tablet I want to use different main.java code
how can I do that?
I am developing android program that have a lot of supported screen sizes and
Share
You can add a value in the res folder for that:
Each booleans.xml should have a different value:
Instead of a boolean “isTablet”, you can separate by sizes depending on what you need. You can then get this value and use it in your code: