Android dp to pixel conversion




Asked on September 15, 2015
How to convert dp into pixel in android.


Replied on September 15, 2015
Follow below step.

int valueInDp = 400;
int valueInPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 
valueInDp, activity.getResources().getDisplayMetrics());



Replied on September 15, 2015
Thanks.

Write Answer








©2024 concretepage.com | Privacy Policy | Contact Us