both resolutions are considered in the layout length, so you need to set the layout according to the height and width of the device manually.
In my opinion, this is the best solution. I applied the same solution for my application.
Example
DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); height = dm.heightPixels; width = dm.widthPixels; if (height == 854 || width == 480) {
You must check the specified condition in the onCreate () method.
source share