I've got an Activity
which uses
getWindow().getDecorView().getWindowVisibleDisplayFrame(rectangle);
to determine the useable screen space and decide where to place images.
Returning to the Activity after I click the hardware "back" button to leave the Activity
, the rectangle values are
(0,0,800,480)
However, returning to the Activity after I click the hardware "home" button to leave the Activity
, the rectangle values are
(0,38,800,480)
which throws off the display and the image placement.
How can I ensure I get a consistent values when calling
getWindow().getDecorView().getWindowVisibleDisplayFrame(rectangle);
no matter how I left the app?
UPDATE: Thanks to @Reno for helping test; it seems to be dependent on Android version than the device.