Getting the size of the window WITHOUT title/notification bars

后端 未结 5 808
傲寒
傲寒 2021-02-07 04:19

I\'ve been playing around with Android development and one of the things I\'d like to be able to do is dynamically create a background image for my windows, similar to the one b

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-07 04:52

    in the first onDraw, call getWidth, getHeight. these will not be valid before then.

    if you are not using a custom view/layout then you can instead call getWidth/getHeight during the first onWindowFocusChanged

提交回复
热议问题