Created
December 10, 2012 15:05
-
-
Save shakalaca/4251100 to your computer and use it in GitHub Desktop.
Detect current window size for Samsung Multi-Window system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mRootContainer = (RelativeLayout) findViewById(R.id.root_container); | |
ViewTreeObserver vto = mRootContainer.getViewTreeObserver(); | |
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { | |
@Override | |
public void onGlobalLayout() { | |
// get current window size | |
int newWidth = mRootContainer.getWidth(); | |
int newHeight = mRootContainer.getHeight(); | |
// do whatever you want ... | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment