Samsung Multiple Window Support - Screen Size

I am currently developing my application for compatibility with the Samsung multi-window feature introduced in galaxy note 2 and soon in galaxy s3. If you do not know what I'm talking about:
(source: androidheadlines.com )

If you're interested, here is a link to find out how to do this: here

My problem is that I need to know the height / width that my application uses. I'm doing it:

displaymetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); heightScreen = displaymetrics.heightPixels; widthScreen = displaymetrics.widthPixels; 

But this returns the size of the entire screen, not just the part that my application uses. My activity consists only of Panel occupying all the space, but panel.getHeight () or getWidth () return 0.

How can I get the real height / width?

Thank you in advance.

+4
source share
1 answer

My activity is created only by the group occupying all the space, but panel.getHeight () or getWidth () returns 0.

Please try again later. You are probably checking this on onCreate() , which is AFAIK too soon.

+6
source

Source: https://habr.com/ru/post/1446777/


All Articles