Last active
December 10, 2015 22:16
-
-
Save akuafif/dc2c2053ef5cb5925a1d to your computer and use it in GitHub Desktop.
[Java/Android] Get Screen Width and Height (DisplayMetrics)
This file contains 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
DisplayMetrics metrics = new DisplayMetrics(); | |
getWindowManager().getDefaultDisplay().getMetrics(metrics); | |
// With Picasso | |
Picasso .with(this) | |
.load(pictureURI) | |
.resize(metrics.widthPixels, metrics.heightPixels) | |
.centerCrop() | |
.into(imageView); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment