Good day! It is necessary to get the screen height without status bar (a). There is a code that receives this data:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); SizeDisplay = new Point(); display.getSize(SizeDisplay); Log.d(TAG,"Width " + String.valueOf(SizeDisplay.x)); Log.d(TAG,"Height " + String.valueOf(SizeDisplay.y)); }
On the tablet, everything is fine here is the logcat data for the tablet:
08-29 21:41:51.309 30926-30926/com.kuldiegor.Sudoku D/kuldiegor: Width 1200 08-29 21:41:51.309 30926-30926/com.kuldiegor.Sudoku D/kuldiegor: Height 1848 08-29 21:42:20.882 30926-30926/com.kuldiegor.Sudoku D/kuldiegor: Width 1920 08-29 21:42:20.882 30926-30926/com.kuldiegor.Sudoku D/kuldiegor: Height 1128
But on the smartphone in the landscape, nothing changes, and all the markup leaves me.
For smartphone:
08-29 21:45:56.531 28855-28855/com.kuldiegor.Sudoku D/kuldiegor: Width 480 08-29 21:45:56.532 28855-28855/com.kuldiegor.Sudoku D/kuldiegor: Height 854 08-29 21:46:05.328 28855-28855/com.kuldiegor.Sudoku D/kuldiegor: Width 854 08-29 21:46:05.328 28855-28855/com.kuldiegor.Sudoku D/kuldiegor: Height 480
Tell me the solution to this issue?