I have a Service that instantiate a ImageView, using WindowManager class, on the screen, this service have no window or visible objects. When I try to set the position of this ImageView using the WindowManager, it set the Y axis position with an offset, this seems to be caused because of the notication bar that the Windows Manager does consider when positioning the ImageView, but the position calculated is absolute and does not consider the Notification Bar size. I can easy subtract this offset from the position, but for this I need to know the Notification Bar size.
I have found some ways to do it, but most of them uses an activity absolute position, or have the notification Bar size hard coded, accordingly with the screen resolution.
Is there a way to discover the Notification Bar size, that I do not need to use hard coded values and do not need any visualizible objects?